Add SharePoint 2013 users to site collection using PowerShell

http://room8-hair.co.uk/category/beauty/ In SharePoint many times you give users permission but you would not be able to access them when using with custom app or custom component you  build until user access the site once. This is because SharePoint maintains the list of all the users  under User Information List. This list is hidden list that you cannot access from the user interface. Even if you go to this list it will only show you the users but not allow you to add users to the list.

go to site Following PowerShell will add users to list without them accessing the site. the following code only adds one user but you can get creative and read the users from CSV or XML and add them in the loop.

buy provigil london $site = Get-SPSite https://SiteCollectionURL/
$web = $site.OpenWeb()
$user = $web.EnsureUser(“DOMAIN\user”)
$web.AllUsers.Add($user.LoginName,$user.Email, $user.Name,“Added Using PowerShell”)
$web.Update()

$web.Dispose()
$site.Dispose()