SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used following script to add a domain group to a site

[Microsoft.SharePoint.SPUser]$spuser = $web.EnsureUser("WM\My Group name")  
Set-SPUser -Identity $spuser -Web "http://myweb" -AddPermissionLevel "Läsa"

Now I run following script to update (sync) the group from AD

$web = Get-SPWeb -Identity "http://myweb" //is root web
$user = $web | Get-SPUser -Identity "WM\My Group name" -ErrorAction SilentlyContinue
$web | Set-SPUser -Identity $user -SyncFromAD

but it says Set-SPUser : Cannot get the full name or e-mail address of user "WM\My Group name"

any idea why? thanks

share|improve this question
Do the user names show in central admin in the user profile manager service? Does the user you are running the script as have the permissions to the service? – Hugh Wood Nov 29 '12 at 16:13
No, I can't find the profile in UPS find profiles. – Medes Nov 29 '12 at 20:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.