Office 365 PowerShell remoting the basics

by Arman Obosyan 30. January 2014 21:29

Office 365 is designed to be very oriented to Windows PowerShell and in fact that not all administration tasks are available through the Office 365 Administration Portal’s Graphical User Interface (GUI), but they are all available through PowerShell. Therefore, Windows PowerShell is the superset administration tool and a definite requirement in your toolkit.

In addition of PowerShell we also need Windows Azure AD Module and Windows PowerShell Integrated Scripting Environment (ISE)

Before we download and install Windows Azure AD Module we need to install Microsoft Online Services Sign-in Assistant.

Download Online Services Sign-in Assistant latest version from here. After you will install it next we need to install Windows Azure AD Module you can download latest from here http://aka.ms/aadposhand read latest updates in documentation.

OK, after downloading and installing all components lets try to connect to our Office 365 subscription there is no difference in connection and using in Trial or Regal Subscription, if you do not have subscription yet, register your trial from here 

Find in programs or on your desktop Windows Azure Active Directory Module for Windows PowerShell and run it.

All we need to connect to our Office 365 is:

$cred = Get-Credential
Connect-MsolService -Credential $cred

after entering you credentials, lets try some command, lets check our subscription status

Get-MsolSubscription

So that’s all, we are connected from PowerShell, you can also save command to .ps1 file for later use, and do not forgot to Set-ExecutionPolicy –ExecutionPolicy Unrestricted otherwise you will get errors running .ps1 file.

The same way you can use commands and script that you saved in .ps1 in Windows PowerShell Integrated Scripting Environment (ISE). We will use later PowerShell ISE for easy management.

For administering Exchange you might want to import cmdlets 

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic –AllowRedirection
Import-PSSession $Session

It is important that you close a PSSession after you are done. The reason for closing a PSSession is because of the connection limit in place as a security measure. If you do not close a PSSession, you will need to wait for the session to time out. If there are five sessions of PSSession open, you will not be able to establish additional sessions

Remove-PSSession $Session

That’s it for now I will continue post about PowerShell and Office 365

In addition try this Office 365 Helper Scriptsit will help you to understand and prepare for future advanced administering of Office 365

---

Tags:

Pingbacks and trackbacks (1)+

Comments are closed

© 2008-2012, Arman Obosyan, Postmaster.GE
Powered by BlogEngine.NET 2.6.0.18
Hosted on Windows Azure and IIS8

About the author

Arman Obosyan is an experienced IT Pro. with over 15 years work experience in Information Technologies sector.

Certified since 2003 year, passed following certifications MCP, MCSA, MCSE, MCTS, MCITP, Exin ITIL and VMware Certified Professional (VCP)

In 2010 Was awarded a Microsoft Most Valuable Professional (MVP)

--------

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent anyone else's view in any way, including those of my employer.



Live Trafic

 

Calendar

<<  December 2014  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

TextBox