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