Techit Tricks

You can download videos of CCNA | Azure | Vmware | AWS | Citrix | HP

Updating Users Email Addresses In Active Directory Using Power Shell

I'm referring to the Email address value that is listed on the user object in Active Directory,It not affect any Exchange server Settings.

Follow the below Steps:

Step 1:

Open Windows Power Shell in Administrator mode.

Run the below Command in Power Shell.
Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase 'DC=test,DC=net' | `
    ForEach-Object { Set-ADUser -EmailAddress ($_.samaccountname + '@test.net') -Identity $_ }

Note : Execute both commands separately.

Step 2:

Now you may, (like on my test network above,) have your user logon name set to something other than firstname.lastname if so and you would prefer to set the Email value to [email protected] then use the following instead.

Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase 'DC=test,DC=net' | `
    ForEach-Object { Set-ADUser -EmailAddress ($_.givenName + '.' + $_.surname + '@test.net') -Identity $_ }

Note : Execute both commands separately.


Step 3:

Close and then Restart.

Email Address Updated Successfully.

 



EmoticonEmoticon