I have the following little scrip that changes the UPN of users in AD. I'd like
it to also set the email address value on the user account. The field is blank
at this time and I'd like it filled in with the username + the $newSuffix. How
about I do that?
$oldSuffix = 'corp.viamonstra.local'
$newSuffix = 'student2.info'
get-aduser -filter * | forEach-Object {
$newUpn = $_.UserPrincipalName.Replace($oldSuffix,$newSuffix)
$_ | Set-ADUser -UserPrincipalName $newUpn -Verbose }
________________________________
John Marcum
MCITP, MCTS, MCSA
Desktop Architect
Bradley Arant Boult Cummings LLP
________________________________
[MVP] <https://mvp.microsoft.com/en-us/overview>
[MMS] <http://mmsmoa.com/>
________________________________
Confidentiality Notice: This e-mail is from a law firm and may be protected by
the attorney-client or work product privileges. If you have received this
message in error, please notify the sender by replying to this e-mail and then
delete it from your computer.
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1