i tried to add users tru sharepoint 2013 powershell .bt it shows "the specific user is not found "..can anybody help me.below is my code
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue#Import the List of Users from a .csv file,$UserList= Import-CSV "C:\UserList.csv" #Get the Web$web = Get-SPWeb "http://site/" foreach ($Row in $UserList){ #Get the Group $Group = $web.Groups[$Row.GroupName] #Validate the user name try { $user = $web.Site.RootWeb.EnsureUser($Row.AccountName) } catch [system.exception] { write-host $_.Exception.Message } #Add user if valid user name is provided if($user -ne $null) { $Group.AddUser($user) write-host $user.AccountName }}#Dispose the web object$Web.Dispose()
.My CSV file has only AccountName and GroupName (AccountName in the format of: Domain\username)









