Manage Office365 Via PowerShell (Step 1. Connect to Office365)

The Microsoft’s Software as a Services (SaaS) offering is a set of different components, that I like to call building block, that sits on top of what is called Office365.
The basic components are:

  1. Office365 (Main Component to manage Domains, Users, Licenses, etc)
    1. Exchange Online
    2. SharePoint Online
    3. Skype for Business
    4. Office ProPlus
    5. Yammer

In this particular guide, we will be connecting to Office365 (the main building block) via PowerShell where we will be able to automate the licenses assignment, manage our domain or change the login name of our users.

To connect to Office we just need to follow three basic steps:

  1. Install the required software:
  2. Open the Windows Azure Active Directory Module: Search for the Windows Azure Active Directory Module for Windows PowerShell
  3. Connect to your Office365 Tenant
$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential 

After running the last command you will see no response. Therefore, I suggest you to request any information to the Office365 servers to confirm the connection. For instance, you can do Get-MsolAccountSku to return your current Office365 subscriptions.

 

New Office 365 (Exchange Online) Storage Size Limit

As of today (July 2016) the mailbox limit for a shared mailbox storage is 50GB (Not 10GB). To access a shared mailbox, a user must have an Exchange Online license. Shared mailboxes don’t require a separate license. However, if you want to enable In-Place Archive or put an In-Place Hold or a Litigation Hold on a shared mailbox, you must assign an Exchange Online Plan 1 with Exchange Online Archiving or Exchange Online Plan 2 license to the mailbox. Source: https://technet.microsoft.com/en-us/library/exchange-online-limits.aspx

Force AAD Connect Synchronization Cycle

The scheduler will run by default run every 30 minutes. In some cases you might want to run a sync cycle in between the scheduled cycles or you need to run a different type.

Delta Sync Cycle
It could be that you have an urgent change which must be synchronized immediately which is why you need to manually run a cycle. If you need to manually run a cycle, then from PowerShell run:


Start-ADSyncSyncCycle -PolicyType Delta

Full Sync Cycle
If you have made one of the following configuration changes, you need to run a full sync cycle (a.k.a. Initial):

  • Added more objects or attributes to be imported from a source directory
  • Made changes to the Synchronization rules
  • Changed filtering so a different number of objects should be included (e.g. Adding a new OU to the filter)

If you have made one of these changes, then you need to run a full sync cycle so the sync engine has the opportunity to reconsolidate the connector spaces. To initiate a full sync cycle, run:


Start-ADSyncSyncCycle -PolicyType Initial