Skip to content

Instantly share code, notes, and snippets.

@mdnmdn
Created December 19, 2011 14:55
Show Gist options
  • Save mdnmdn/1497551 to your computer and use it in GitHub Desktop.
Save mdnmdn/1497551 to your computer and use it in GitHub Desktop.
Powershell sharepoint set user email
[system.reflection.assembly]::LoadWithPartialName("Microsoft.Sharepoint")
$siteUrl = "http://sharepoint/"
$site = New-Object Microsoft.SharePoint.SPSite($siteUrl)
$web = $site.rootweb
$email = 'mdnmdn@mymail.com'
$username = 'mdn'
$u = $web.EnsureUser($username)
$u.email = $email
$u.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment