Copying a field to another field in Active Directory


hi, have been trying copy "userprincipalname" "mail" field specific ou in active directory. code im trying use doesnt bring error inst not working, can please point out going wrong?

(i'm using "select-object * -first 5" test before doing full ou)

get-aduser -ldapfilter -searchbase "ou=eop1,ou=le-fenwick,dc=hq,dc=local" '(userprincipalname=*)' -properties mail, userprincipalname | select-object * -first 5 | foreach-object {set-adobject -identity $_.distinguishedname ` -replace @{mail=$_.userprincipalname}}

thanks

your filter should follow -ldapfilter parameter. have part of search base.


richard mueller - mvp directory services



Windows Server  >  Directory Services



Comments

Popular posts from this blog

CRL Revocation always failed

0x300000d errors in Microsoft Remote Desktop client

Failed to query the results of bpa xpath