Let's drop onto our demo machine, and demonstrate how to add a new user in Office 365, using the Office 365 Admin center. First, we'll log on to the Admin center portal at portal.office.com. We'll use an administrative role. I'll use email@example.com and sign in. We'll click the Admin button, and the new Admin center loads. And either from the Home screen we can click Add user or we can enter Users and Active users.
We then need to select the Add a user option, and then complete the user details. Notice that when I tapped through, Office 365 automatically completes several of the fields. However, the username is not being automatically set, and I need to enter this manually. Allocate the product licenses or choose the option to create a user without a product license. I'll select the Office 365 Enterprise E5 license.
Scroll all the way down to the bottom and click Add. Notice that once the user has been added, Office 365 wants to send an email to the user with a password that's been automatically generated. We can override this by saying "Don't send the password", and click Close. We would then need to make a note of the password ourselves, and send this to the user in a different manner. Click Close. We can then click Search and enter the username and click Enter and we'll see that the user has now been created.
So, that was a simple example. Let's now look at how to bulk out new users to Office 365 using PowerShell. First, I'll use an example where I add one user using PowerShell. And then I'll explore further how to add several users in bulk. I prefer to use the PowerShell scripting engine when using PowerShell. This helps me to debug scripts, document them, and also save them for future use. Let's load up the PowerShell ISE using administrative privileges, and then open my script.
I right-click PowerShell, and then run ISE as an administrator. Accept the user account control, and the ISE loads. I've created a PowerShell script already. Let's load this. Open and Add Users to Office 365. Before we can use Office 365 and PowerShell together, we'll need to install two pieces of software. These are the Microsoft Online Services Sign-In Assistant, and also the Windows Azure Active Directory Module for Windows PowerShell.
I'll copy the link and then open a browser, and paste the link for the first tool. And if we scroll down, we can select our language and then click Download. We need to select the architecture that corresponds to our system. I'll select the 64-bit, and then click Next. Allow the download to complete, and click Save. I'm now going to run the tool, and Install. Accept the user account control, and click Finish.
I'll return to my script and select this second tool. And return to the browser. This time we have the option to directly Run or Save the administration tool. I'll click Run. On the dialog box, click Next. Accept the terms, and click Next again, and Next. Finally click Install and Finish. So, we now have both tools installed. We can close out of the Internet Explorer window, and return to my PowerShell script.
The next step is to connect to your Office 365 subscription using PowerShell. We can highlight Row 18. We've defined a string called User Credential which equals the command Get Credential. Let me step into this to show you how this works. I'm highlighting Row 18. I click the Run Selection, and Windows pops up a dialog box requesting my username and password.
These are the credentials required to log on to Office 365. I'll use my firstname.lastname@example.org credentials. I'll enter my password and click OK. Now, that we've stored our credentials in the string, we'll now instruct PowerShell to connect to Office 365 using the credentials supplied earlier. I'll highlight Row 22 and click the Run Selection.
This command uses the credentials I've already supplied and correct connection to Office 365. We can test to see if this works by issuing a command directly to Office 365. I'm going to highlight Row 25 which will issue the command Get-MsolUser, and click the Run Selection. The command completes and displays all active users within my subscription.
Next lets take a look at Row 28. This is where we'll use Office 365 PowerShell to create an individual user account. The command is New-MsolUser and then we'll provide the information required by Office 365 to create a user. In this example, we have display name, first name, last name, user principal name, usage location, and then notice that I'm providing a password within the script.
Let's highlight the row, and then click the Run Selection option. The command completes and the user has been inserted. Let's take a look at our Office 365 portal, click Active users, and search for Randy. And we can see Randy has now been created. Notice that Randy has no assigned products, as this was not part of the PowerShell script. Let's return to our PowerShell script, and now we want PowerShell to import multiple accounts.
Let's look at Row 35 which uses the Import CSV cmdlet. We define the path where the CSV file is stored, and use a pipe command to separate the Import CSV from the For Each loop. So ,for each row of information that PowerShell finds within the CSV file, PowerShell creates a new MsolUser with the information found within the file. If we scroll to the end of this script.
We can see within the PowerShell script the headings such as -UsageLocation and then a $_.UsageLocation. This information is pulled directly from the CSV file. Notice for the password, this is not pulled from the CSV file, we have hard-coded this information directly into the script. Once PowerShell has created all the user accounts from the import CSV file, there's another pipe command which creates a Group Account Results CSV file, detailing results.
Let's take a look at the CSV file, called Small User Import CSV to show you the details that I'm looking to import. Let's go to Desktop, Exercise Files, Resources, and I'm looking for the small user import file. We can see that this is a comma-separated value file, and this will open in Excel. Let's take a look at the headings and the data contained. We have the headings user principal name, first name, last name, display name, and usage location.
These five headings are the minimum required for Office 365 to create an account. Let's close out of Excel. We didn't make any amendments, so we don't need to save. I'll return to the ISE, highlight Row 35, and then click Run Selection. We can see the tool complete successfully. And now, let's test to see if this works. Let's query Office 365 to see if there's one of our new users. We can do this using the Line 39, which requests that we get the Microsoft Online User with the user principal name David L.
Highlight Row 39 and use the Run Selection again. And we can see in the results window that David has been created. You should see the newly added user accounts to the Office 365 subscription. We will leave these in place as we will delete some of them later in this course. In the next video, we will look at user account maintenance including resetting passwords and deleting and restoring users.
LinkedIn Learning is an online learning platform that combines industry-leading content from Lynda.com with LinkedIn’s professional network of more than 500 million member profiles to provide highly personalized course recommendations and a more intuitive learning experience. Learn more.
Learn from recognized industry experts, and get the business, tech, and creative skills that are most in demand.
Receive personal recommendations based on your LinkedIn profile.
Stream courses from your computer or mobile device.
Take courses for every level – beginner to advanced.
Practice while you learn with quizzes, exercise files, and coding windows.
Provide learning for your team or entire organization, with an easy to use experience for managing users, curating content and measuring engagement
For businesses with 150+ licenses Request Office 365 onboarding assistance from FastTrack
You can request remote and personalized assistance with onboarding. Our FastTrack engineers will help you plan your Office 365 project, assess your technical environment, provide remediation guidance, and provide user adoption assistance. For businesses with at least 500 licenses, Microsoft also provides personalized assistance to migrate data to Office 365.
See the FastTrack Center Video: http://aka.ms/meetfasttrack
Get started today: http://fasttrack.microsoft.com
Tip: Businesses with 1-149 licenses still have access to FastTrack guidance via links in the Admin Center and also available at https://aka.ms/setupguidance.
Learn how to keep your users secure and up to date by configuring cloud identity and authentication with Azure AD and Office 365, and enterprise-level mobile device management with Intune. This course covers key topics related to the administration of these services, including users, groups, policies, and roles, and maps to the related domain of Microsoft's Cloud Fundamentals certification exam (98-369). It's ideal for IT professionals responsible for their company's cloud operations as well as those pursuing certification for the first time. Follow along with Andrew Bettany as he covers creating user groups within both Office 365 and Intune, assigning administrative roles, and configuring mobile device management.
Understanding cloud identity and authentication
Managing Office 365 users and groups
Assigning administrative roles
Configuring password expiration policy
Exploring Service Health for Office 365 and Intune
Managing users and devices in Intune
Deploying Intune clients
Setting up mobile device management
Managing Intune policies