In Part I we have answered the basic questions on how to have Arabic Office 365 tenant, in this article we will go through more advanced tasks in managing and administering Office 365.
Users Bulk Import
Creating bulk users on Office 365 can be done based on CSV file and through one of the following options:
- Portal: when using portal to bulk import we will face the limit of 251 row per file, which means the CSV file will have the header row and 250 users, which is easy and will work fine in Arabic for small number of users.
- PowerShell: is the best solution when we need to create thousands of users, the biggest file that I’ve uploaded contained 100,000 users. However the challenge here is managing these users, if you will use Excel to get the list and then save as CSV (which is the typical way) then Excel limit is 65536 row (increased in Excel 2010).
I will not cover using the portal as it is straight forward process, check this article for more details: http://onlinehelp.microsoft.com/en-us/office365-enterprises/ff637601.aspx
Typically we will have users’ list on Excel sheet or on DB then export it to Excel or Access, at the end what we need to have is CSV file, in my experience I’ve found that CSV file with 50,000 users as one batch is good and easy to manage.
This CSV file must be saved as Unicode so Arabic characters can be displayed.
Before playing with the CSV file I have some best practices steps that were very useful on the Admin machine (which will be used to manage and upload users):
- Change the language for non-Unicode programs to Arabic.
- As per Part I of this series we will use ISE, so if you are using Windows 8 it’s already installed if not make sure that you have ISE installed.
- The CSV file must be save as Unicode format. When saving the CSV file from Excel the format of this file is ASCI by default, which is not supporting Unicode characters so the Arabic characters are not supported. However the trick when you have Arabic as default language for non-Unicode program you open the CSV file in Notepad you can read it even if it’s ASCI (because Arabic is the default), if you try to upload that file from ISE you will get the hieroglyphic characters, the solution here is to open the file in notepad and save as in Unicode format, as the following snapshot:
The CSV file format is simple, you can you the following template or create your own template:
USERNAME,FIRSTNAME,LASTNAME,DISPLAYNAME,TITLE,DEPARTMENT,CITY,COUNTRY,upn
mohamed.marzouk,محمد,مرزوق,محمد مرزوق,مدير مبيعات,مبيعات,القاهرة,EGYPT,mohamed.marzouk@meamcs.com
The next step is to use ISE to upload the CSV file to your tenant, follow the following steps:
1. Open ISE and connect to your tenant using the following cmdlet:
Connect-MsolService
2. Run the following cmdlet to import the CSV file:
Import-Csv D:\arab-users.csv | ForEach-Object -Process {New-MsolUser -UserPrincipalName $_.upn -FirstName $_.firstname -LastName $_.lastname -Department $_.department -Title $_.title -City $_.city -Country $_.country -DisplayName $_.displayname -LicenseAssignment meamcs:ENTERPRISEPACK -UsageLocation EG} | Export-Csv -Path d:\result.csv -Encoding unicode
Check the following snapshot:
Before checking the result file, let’s explain this cmdlet, this cmdlet contains 3 parts:
- Import-Csv: this part we are importing the CSV file to the PowerShell without creating any users yet.
- ForEach-Object: in this part we are instructing the PowerShell that for each line in the CSV file (object) we will create new user, this user will have UserPricipalName equal to the value of the “upn” column, FirstName value is equal to the “firstname” column, and so on, the name of the column is coming from $_.columnheader. It’s important also to assign license to that user by using –licenseAssignment switch (you can get this value in your tenant by running get-msolaccountsku), also we have to give value to –UsageLocation which is the location (country) of this user.
- Export-Csv: this is the last part where we instruct the PowerShell to export the result in Unicode format so we can read the Arabic characters.
Last step is to check the result file for two things:
- Any errors.
- And users’ passwords, this password by default must be changed in the first logon.
Check the following snapshot:
In this article we explained how to import Arabic users with PowerShell, next part we will discuss how to manage the Arabic users.
Other Parts:
Part I: Arabic Problems
Part II: Users Bulk Creation
Part III: Users Bulk Modification
Part IV: Dynamic Distribution Group