date - Edit Description field for users -
i’m trying clean ad user accounts, in past organization put date in beginning of description field users…
i can text in description field using powershell don’t know how delete date in “description” field.
and date in field written in following formats: mm/dd/yy or mm/dd/yyyy
get-aduser -searchbase $ou_to_search -filter {(description -like '*/*/* ^az') -and (enabled -eq $true)} -properties cn,description | export-csv c:\temp\a_users.csv i’m sure there better way of getting date… i’m not there yet.
you set description field variable , use -replace parameter remove date so:
$this = $this -replace "([0-9]+)/([0-9]+)/([0-9]+) ","" then, it's matter of using set-aduser replace current description
Comments
Post a Comment