Here we are showing how to import users from csv to SharePoint site using PowerShell, In some cases we have users available in the document or in notepad, we have to add those users into SharePoint group, adding 2 or 3 users manually is not a problem but adding 50+ users it will take lot of effort for a user to add in to SharePoint site.
For this using PowerShell we can add it easily, check the below code snippet and excel with CSV format looks.
$UserinfoCSV = "C:\DotNetSharePoint\ImportUsers.csv"
# Import the CSV file
#In CSV there are no headers,CSV having two columns values one is SP group name and another one is username.
$UserInfo = Import-CSV $UserinfoCSV -header("GroupName","UserAccount")
#Get the Web
$Web = Get-SPWeb http://dotnetsharepoint.com/sites/sharepoint/importusers
#looping each user from CSV file
foreach ($user in $UserInfo)
$Group = $web.SiteGroups[$User.GroupName]
$User = $web.Site.RootWeb.EnsureUser($User.UserAccount)