How to Update User Email Address in SharePoint using PowerShell?

Problem: SharePoint workflows failed because, user has no email address!
sharepoint change user email address
You can get the user's Email address with this PowerShell one-liner:
(Get-SPUser -Identity "Crescent\bourgeois" -Web "").email

Solution is simple! SharePoint user has no email address, so add email address to users to resolve the issue!

How to update SharePoint user email address?
To update user email address, Use, Set-SPUser cmdlet. Here are some examples:
Set-SPUser -Identity "i:0#.w|Domain\username" -Email "[email protected]" -Web http://sharepoint-site-url
Set-SPUser -Identity "i:0#.w|Crescent\Salaudeen" -Email "[email protected]" -Web
This sets the Email ID of the user to given Email for entire site collection.

Change user email address from Active Directory:
You can Sync User's Email ID from Active Directory
Set-SPUser -Identity "i:0#.w|Domain\username" -Web "http://sharepoint-site-url" -SyncFromAD

Set-SPUser -Identity "i:0#.w|Crescent\Salaudeen" -Web "" -SyncFromAD
This script syncs user properties such as Display Name, Email, Department, etc from Active directory. Here is the result of updated user Email:
update user email in sharepoint

PowerShell script to update User Email address for all Sites in the web application:
Use this script to update user's Email address for the entire web application.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Update Email for all sites in the web application
Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | Foreach-object {
    Write-host "Processing:" $_.Rootweb.URL

    #Get the User's Current Display Name and E-mail
    $User = Get-SPUser -Identity $UserAccount -Web $_.Rootweb.URL

    if($User -ne $null)
        Set-SPUser -Identity "i:0#.w|Crescent\Salaudeen" -Email "[email protected]" –Web $_.Rootweb.URL
To Sync All user details such as Email, Display name, etc from Active directory, use:
Get-SPUser -Web http://web-app-url | Set-SPUser –SyncFromAD


  1. How to Update User Email Address in SharePoint 2007 using stsadm.exe ?
    Could you please send the command for SP 2007.

  2. Thanks for sharing. It worked very well.

  3. Hi

    I tried this Get-SPUser -Web http://web-app-url | Set-SPUser –SyncFromAD, but gives error - can not get the full name or email address of user error- any inputs pls.


Please Login and comment to get your questions answered!

Powered by Blogger.