I have a problem with a simple script. I need to copy attributes (STATE to CITY) on all users in my OU. I found this script, but there is an error somewhere.
Could someone help me with this?
Get-ADUser -Filter * -SearchBase "MY OU" -Properties city, state |
ForEach-Object {
Set-ADObject -Identity $_.DistinguishedName ` -Replace @{city=$($_.state)}
}