Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
1  
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
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.