If you’re familiar with Office 365, you know that you can perform administrative tasks through Office 365’s Web-based interface. Doing so executes one or more PowerShell commands under the covers. In Office 365, you can also run those commands directly from a PowerShell session on your local computer. The problem is, many admins don’t know how to connect to PowerShell via Office 365 in the first place.

By submitting your personal information, you agree to receive emails regarding relevant products and special offers from TechTarget and its partners. You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy.

Connecting to PowerShell gives you complete control -- and plenty of automation -- for managing Office 365 resources. This is helpful because Microsoft is constantly adding new Office 365 administrative tasks to the collaboration suite.

The third command generates a prompt for your Office 365 username and password; it will appear as a standard Windows dialog box. Assuming you have administrative privileges, enter your username (username@domain.onmicrosoft.com) and password. Those credentials are stored in the $LiveCred object for later use.

The fourth command creates a new PowerShell session that actually exists on your Office 365 servers. Since this is a remote session, the last two commands connect and import the remote session into your local session.

This whole process merges the remote session with your local session to create a single, unified management console. Through this session, you can manage resources both locally and inside Office 365’s cloud.

As you can imagine, these commands can get cumbersome to plug in each time you need to manage Office 365. Fortunately, you can automate the process by adding them to your $profile. After doing so, they will automatically execute each time you launch a PowerShell session.

If you don’t have a $profile , you Get one by creating a text file named Microsoft.PowerShell_profile.ps1 and saving it to the C:\Users\<userName>\Documents\WindowsPowerShell folder.

About the author:Greg Shields,MVP, is a partner and principal technologist with Concentrated Technology. An IT industry analyst, author, speaker and trainer, you can find Greg at www.concentratedtech.com.

GUIDE SECTIONS

0 comments

E-Mail

Username / Password

Password

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy