How to create an Office 365 service account for GSX 365 Usage Reports

This article explains how to create a Read-Only Administrator account in Office 365 for use with GSX 365 Usage and GSX 365 Security Audit. This is for use with our Manual signup process and it is important that you complete all the steps.

If you require any assistance or receive any error messages during this process please do not hesitate to contact us at [email protected]

Your organization will not be charged by Microsoft for this account as it does not require an Office 365 licence. 

Connecting to Office 365 using PowerShell

Before we begin, you need to install the “Microsoft Online Service Module” onto your machine.

Now open up Windows PowerShell and Copy & Paste in the following commands to connect to Office 365.

Please enter the username and password of an Office 365 Administrator account when prompted.

$Office365credentials = Get-Credential
Import-Module MSOnline
Connect-MsolService -Credential $Office365credentials
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://ps.outlook.com/powershell/” -Credential $Office365credentials -Authentication Basic -AllowRedirection
Import-PSSession $Session

You should now be connected to Office 365. You can run the Get-MsolUsercmdlet and if you are correctly connected you will see a list of the users within your tenant.

Here’s what it will look like.

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\Dan> $Office365credentials = Get-Credential
PS C:\Users\Dan> Import-Module MSOnline
PS C:\Users\Dan> Connect-MsolService -Credential $Office365credentials
PS C:\Users\Dan> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.outlook.com/p
owershell/" -Credential $Office365credentials -Authentication Basic -AllowRedirection
PS C:\Users\Dan> Import-PSSession $Session

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Script     tmp_ebf2ba70-ef57-4b10... {Set-RoleGroup, Set-RMSTrustedPublishingDomain, Disable-UMAutoAttendant,...

PS C:\Users\Dan> Get-MSOLUser

UserPrincipalName                                     DisplayName                             isLicensed
------------------------------                                     ---------------------                             ----------------
[email protected]             Dan Rose                                     True
[email protected]             Thomas Na                                  True
[email protected]        Jill Smith                                     True

PS C:\scripts\Dan>

 

Creating the Service Account

Now that you are connected to Office 365 in PowerShell, we can create the Service account.

Modify the line below and set the company.onmicrosoft.com part to match your own Office 365 .onmicrosoft.com domain and replace the password with a secure password of your own. We recommend a password of 10 characters of more that includes a mixture of Capital and Lower case letters, numbers and special characters.

New-MSolUser -DisplayName "Service Account for GSX 365 Usage" -UserPrincipalName "[email protected]" -Password "Password123" -PasswordNeverExpires $true -ForceChangePassword $false

 

Next we need to add our new account to the 'View-Only Organization Management' group and the 'Service Support Administrator' group. You can do this by copying and pasting the following 2 lines into the PowerShell window.

Remember to set the company.onmicrosoft.com part to match your Office 365 domain name


Add-RoleGroupMember -identity "View-Only Organization Management" -member [email protected]

Add-MSOLRoleMember –RoleName “Service Support Administrator” –RoleMemberEmailAddress [email protected]

Please note that you will not receive any confirmation if the commands are successful.

The account has now been created and you can complete the manual signup process.

If you have any problems with the account creation or wish to speak to us you can log a ticket by emailing your question to [email protected]