You may come up with requirement to update User Email address in SharePoint, you can use below script to do so:
$user = Get-SPUser -Identity <domain\user-id> -Web <”Web Application URL”>
$user | Select UserLogin,DisplayName,Email
Set-SPUser -Identity <domain\userId> -Email <email-id> -Web <”Web Application URL”>
Example:
$user = Get-SPUser -Identity “corp\mnj” -Web http://contoso.com:1111/
$user | Select UserLogin,DisplayName,Email
Set-SPUser -Identity “corp\mnj” -Email “mnj.plwl@contoso.com” -Web http://contoso.com:1111/
$user = Get-SPUser -Identity <domain\user-id> -Web <”Web Application URL”>
$user | Select UserLogin,DisplayName,Email
Set-SPUser -Identity <domain\userId> -Email <email-id> -Web <”Web Application URL”>
Example:
$user = Get-SPUser -Identity “corp\mnj” -Web http://contoso.com:1111/
$user | Select UserLogin,DisplayName,Email
Set-SPUser -Identity “corp\mnj” -Email “mnj.plwl@contoso.com” -Web http://contoso.com:1111/
No comments:
Post a Comment