Bulk import the user information from CSV file

This script could be used to bulk add user information for Office365 administrator from CSV file.

 
 
 
 
 
4.3 Star
(3)
4,804 times
Add to favorites
Office
7/29/2013
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • I get the write exception error
    1 Posts | Last post June 24, 2014
    • Add-UserToO365 : Exception of type 'Microsoft.PowerShell.Commands.WriteErrorException' was thrown.
      At line:168 char:9
      +         Add-UserToO365 -UserName $.UserName -DisplayName $.DisplayName -Departme ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-UserToO365
  • Error - Import-OSCUser
    2 Posts | Last post June 02, 2014
    • After run steps 1 and 2, the step 3 - erro generated to run 'Import-OSCUser'. As follows.
      	{
      	Import-OSCUser : A positional parameter cannot be found that accepts argument
      	'Users\Teste02_CSV.csv'.
      	At line:1 char:1
      	+ Import-OSCUser -filepath D:\temp\Seduc-MT\Criacao Users\Teste02_CSV.csv
      	+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      	    + CategoryInfo          : InvalidArgument: (:) [Import-OSCUser], Parameter
      	   BindingException
      	    + FullyQualifiedErrorId : PositionalParameterNotFound,Import-OSCUser
      	}
      	
      Validated the CSV file through the Portal Office 365 -> Users and Groups -> Bulk Users.
      	
      What do for this case?
      	
      Thank you.
      
      
    • Hi Marcelo,
      
      Your csv file path contains a space.  Please put your path inside quotes, like this:
      
      import-oscuser -filepath "D:\temp\Seduc-MT\Criacao Users\Teste02_CSV.csv"
      
      Regards
      
      Chris