Change user attributes using Windows PowerShell

Share this:

Hello folks,

Sometimes we should alter attributes

get-qaduser | foreach-object { set-qaduser $_.name -ObjectAttributes @{mail = $_.name + ‘domain.ca’ } }

Ok, Is it not enough? You want to change only for the determined users which belongs to certain OU.. ok.. let’s go:

get-qaduser -searchpath ‘ou=user, dc=apatricio,dc=local’ | foreach-object { set-qaduser $_.name -ObjectAttributes @{mail = $_.name + ‘domain.ca’ } }

Best Regards,
Anderson Patricio

Written by Anderson Patricio

Anderson Patricio is a Canadian Exchange Server MVP and MCSM (Solutions Master) and he contributes to the Microsoft Community with articles, tutorials, blog posts, forums and book reviews. He is a regular contributor at MSExchange.org, ITPROCentral.com and AndersonPatricio.org (Portuguese).