Monday, April 27, 2015

SharePoint: Change User email address for a site collection PowerShell

Change User email address for a site collection PowerShell


Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue
$User = Get-SPUser -identity " Domain\User" -Email" -web "https://xyz.com"
write-output $($User.Email)
Set-SPUser -Identity "Domain\User" -Email "rku@nz.com" -Web "https://xyz.com"
write-output $($User.Email)



$web =Get-SPWeb http://rku:1111/sites/dev/
$list=$web.Lists["User Information List"]
$user =$list.GetItemById(3)
$user["SipAddress"]=""
$user["EMail"]="Rku@test.com"
$user.update()
$list.update()
$web.update()

No comments:

Post a Comment