Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

Move-ADObject and "Protect from Deletion"

$
0
0
I am using the following script to search for stale accounts and move them into a "Stale" OU.   The problem is that we have some users checked as "Protect From Accidental Deletion" and for good reason.  When the Script comes across these accounts, it bails out entirely.  I would prefer it to "Skip" and carry one with the accounts it can move.  How do I fix it?   I setup a test OU and put in a handful of known "stale" accounts and it works fine other. 

PS C:\> Search-ADAccount -SearchBase "ou=Test_Users........." -UsersOnly -AccountInactive -TimeSpan 10.00:00:00 | Move-ADObject -TargetPath "ou=Stale_Users....."

Viewing all articles
Browse latest Browse all 31638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>