Hello,
We currently use below to add 1 to any accounts' displayName attribute that are in a quarantine OU waiting to be deleted. It is part of a larger script.
Get-ADUser -SearchBase “OU=Quarantined,OU=Accounts,DC=Contoso,DC=com” -Filter { displayName -notlike "1"} -Properties displayname |
ForEach-Object {Set-ADObject -Identity $.distinguishedName -Replace @{displayName="$("1" + $.displayname)"}}
For some users who do return I have devised a script to enable various areas but I cannot seem to remove 1 from the displayName attribute if it exists. Any help would be appreciated.