Thursday, September 22, 2011

Microsoft 365 Cloud Remote Management

Alright so I been learning how to play with Microsoft 365. In particular management of Exchange server via “Exchange Management Console” and “Exchange Management Shell aka Powershell”.

I found very amazing tutorial on http://technet.microsoft.com/en-us/edge/Video/hh278971 by Naomi Alpern. I watched the whole thing since it was very interesting. But you if you really want to skip it to fun part then skip it to 20 minutes into to tutorial.

First of install "Exchange Management Tools" from Exchange 2010 Sp1 cd. I downloaded mine off microsoft. Extract the files and run the setup from run. Cmd into the folder where exchange 2010 sp1 setup file is located and write "setup /R:MT"

To configure Exchange Management Console do the following steps:-

·         From the “Exchange Management Console” right click on “Microsoft Exchange” and click on “Add Exchange Forest…”

·         You will be prompted with the below dialog box. In “Specify a friendly name for this Exchange forest”. Write whatever is easy to remember for you. I put mine as “Exchange Online”. After that make sure you select “Exchange Online” from the drop down menu of “Specify the FQDN or URL of the server running the Remote PowerShell instance:” Click “OK” and it will ask you for the username and password for your Microsoft 365 account.
·         After you put in your username and password it will refresh the EMC and if it accepts the credentials it will list your exchange forest in the list.

That was the "Exchange Management Console" connection settings. Now for "Exchange Management Shell (PowerShell)"

To connect through PowerShell use the following script
========================================
Set-ExecutionPolicy unrestricted
#Ask for credentials
$cred = Get-Credential
#Setup a powershell session to the Exhcange online server
$O365 = New-PSSession -ConfigurationName Microsoft.Exchange –ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic –AllowRedirection
#Import the cmdlets to your local computer
$importcmd = Import-PSSession $O365
=============================================

Update : Someone asked me to automate the username and password. So here's the script with username & password already added :-

=============================================
Set-ExecutionPolicy unrestricted
#Change to your username of microsoft 360 below
$userName = "username@domain.onmicrosoft.com"
#Change yourpasswordhere with your password
$passWord = ConvertTo-SecureString "yourpasswordhere" -Force -AsPlainText
$cred = New-Object System.Management.Automation.PSCredential($userName, $passWord)
$O365 = New-PSSession -ConfigurationName Microsoft.Exchange –ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic –AllowRedirection
$importcmd = Import-PSSession $O365
========================================
The above will connect you to your online cloud exchange server. You can test it out by running exchange commands. get-mailbox or anything else.

That pretty much sums it up. Not much different from your local exchange server. Do keep in mind there are few settings not visible on cloud exchange server since its running multiple clients setup (hosted exchange setup).

No comments:

Post a Comment