Powershell

Add user in list from csv or excel file using PowerShell

$spAssigment = Start-SPAssignment    #Use to dispose SPWeb safely $spWeb = Get-SPWeb “http://weburl” -AssignmentCollection $spAssignment     #Get SPWeb Instance $spList = $spWeb.Lists[“ListName”]    #Get list instance $testcsv = import-csv C:\user.csv Write-Host “Start To Add Item” foreach($test in $testcsv) { $spItem = $spList.AddItem() $spItem[“User”] = $test.UserID # .UserID is column name $spItem.Update() # ====================== $UserID

NGenious Solutions