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

Adding a user trough the following PS command line works just fine:

Set-SPUser -Identity "Domain\LoginName" -Web $Web.Url -Group "GroupName"

The problem occurs when the user is deleted and then the above command executed again. No exception throw, but the user is not added. Closing the PowerShell console (or in the PS editor) and running again the command still doesn't work.

Any idea?

share|improve this question

If a user is deleted this method doesn't work as the Set-SPUser is used to:

Configures properties on an existing user. (Technet - Set-SPUser)

But if your user is deleted from SharePoint, but do exist in Active Directory you can add the user using New-SPUser:

New-SPUser –UserAlias "AD\JoDo" –displayname "John Doe" –web $Web.Url -Group "GroupName"
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.