My Developer blog

Welcome to my blog, I wanted a place that I could document and share all my development experiences and if it helps people on the way all the better. this is the beginning of the site but I have lots of ideas and will constantly add to it and hopefully blog about it on the way.

Connecting to Office 365 and it's services using PowerShell.


This month post I a bit of a pick a mix on getting connected to Office 365 and it's services, I have my Office 365 exams coming up and there is lots of PowerShell commands to lean so I thought by building a series of blogs to cover each section it will help me learn what is needed, and hopefully help someone else in the process…

This first blog is a mix-up of each service and where to find the modules and all the PowerShell commands I can find, I hope they can help me and help others in gaining knowledge or just handy having all the resources in one place

NOTE: in order to make this work it would you do either need to have an Office 365 subscription or trail account, you can get set up on an E3 account through this link and hitting the free trail, this will give you access to everything that you need to follow along…

Then we need to download a few modules;

First we need to download and Install the Azure AD Module

The First install the Microsoft Online Services Sign-In Assistant for IT Professionals RTW from the Microsoft Download Center. Then install the Azure Active Directory Module for Windows PowerShell (64-bit version), and click Run to run the installer package.

You will then have Windows Azure AD Module for PowerShell install

Note: You can use Windows PowerShell version 3 upwards.

Then we can connect using the following command


$credentials=get-credential
Import-Module MSOnline
Connect-MsolService
Connect-MSOLService -Credential $credential



Then just to start and make sure you have a connection type: Get-MsolUser




And you are now connected, for more commands to manage users and groups please click here

11Apr

Skype for Business Online, Windows PowerShell Module

Go to here and download the Skype for Business Online, Windows PowerShell Module

To connect to Skype for business online use this command


$credential = Get-Credential
$session = New-CsOnlineSession -Credential $credential
Import-PSSession $session
Get-Module



Run a Get-Module command to make sure you have a connection.




Now that you are now connected you can manage Skype Online, for more commands please click here

Once Finished with the PSSession you can close the connection with this command

Remove-PSSession

Connecting to Exchange online

Windows PowerShell needs to be configured to run scripts, you need to allow this

Open PowerShell, by right clicking on the icon and running as Administrator

the run the following command

Set-ExecutionPolicy RemoteSigned



Select [A] Yes to all




Set Credentials


$UserCredential = Get-Credential



New Session

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Then run


$UserCredential = Get-Credential



You are now connected




Run the following command to get so return mailboxes


GET-Mailbox



Now that you are now connected you can manage Exchange Online, for more commands please click here


Once you have finished you can kill the session, by running the following command


Remove-PSSession $Session

SharePoint Online Management Shell

Go to here and download the SharePoint Online Management Shell

To connect to SharePoint Online use this command;


$credential = Get-Credential
Import-Module Microsoft.Online.SharePoint.Powershell
Connect-SPOService -url https://YOURACCOUNT-admin.sharepoint.com -Credential $credential



Run a Get-Module command to make sure you have a connection.




Now that you are now connected you can manage SharePoint Online, for more commands please click here

Once Finished with the PSSession you can close the connection with this command

Remove-PSSession