Tag Archives: PowerShell

New Azure AD PowerShell Module and Windows Server 2008 R2

A new version of the Azure Active Directory Module for PowerShell was released in mid September 2014.  You can find the link to it here…


That’s great except if you are trying to install it on Windows Server 2008 R2.  If you read the link it looks like all you need is the version of .NET and PowerShell that comes with Windows 2008 R2 (3.51 and 2.0 respectively).

When you install the updated version of the AAD Module for PowerShell on a vanilla machine and launch it though you are greeted with this message…


That doesn’t look good!  I could never find any official support article but I found a couple of hints that it needed PowerShell 3.0.  So I installed Windows Management Framework 3.0 on my system and tested again and it worked.  You can download it here…


Note, if you are installing this on a production server, make sure you aren’t running any of the unsupported products listed under the System Requirements section.

Hope this helps!


Office 365 PowerShell–The Two-Headed Monster

One of the best features in Office 365 is the ability to manage it via PowerShell.  However, currently there are two separate PowerShell interfaces into Office 365 depending on what you’re trying to do.  If you want to manage settings under the main Portal (think AD stuff) you connect via a PowerShell 1.0 interface requiring you to load tools on your local workstation.  If you want to manage things under Exchange Online you utilize PowerShell remoting which requires you to have nothing installed on your local system other than PowerShell 2.0.  Here’s the specifics for each method…


Portal PowerShell Administration


  • Windows 7 or Windows Server 2008 R2
  • Windows PowerShell and the .NET Framework 3.5.1 enabled

Software to Install

  • Microsoft Online Services Sign-In Assistant – 32bit  64bit
  • Microsoft Online Services Module for PowerShell – 32bit  64bit

Connecting to the Microsoft Online Services Portal

  1. Click on Start > All Programs > Microsoft Online Services > Microsoft Online Services Module for PowerShell
  2. Run “Connect-MsolService”
  3. When prompted enter the credentials of an administrator account
  4. To get a list of all available commands run “Get-Command –Module MSOnline”

For a complete list of all commands and usage click on the following link…



Exchange Online PowerShell Administration


  • Windows 7 or Windows Server 2008 R2 – No Additional Software Necessary
  • Windows XP SP3, Vista SP1, Server 2003 SP2, Server 2008 SP1 – See Below

Software to Install

Connecting to Exchange Online

  1. Click on Start > All Programs > Accessories > Windows PowerShell > Windows PowerShell
  2. The first time run “Set-ExecutionPolicy RemoteSigned”
  3. Run “$LiveCred = Get-Credential”
  4. When prompted enter the credentials of an administrator account
  5. Run “$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection”
  6. Run “Import-PSSession $Session”
  7. To get a list of all commands run “Get-Command –Module tmp*”

For a complete list of all commands and usage click on the following link…


Configure Conference Rooms in Exchange 2007

In Exchange 2007 you can use the following command to setup a Resource Mailbox to automatically book calendar appointments:

Set-MailboxCalendarSettings -Identity "RoomName" -AutomateProcessing AutoAccept

What about if you don’t want it to automatically book.  Instead you want the meeting request to go to a delegate (or delegates) who then can approve or deny the request.  You can use the following command:

Set-MailboxCalendarSettings -Identity "RoomName" -AutomateProcessing AutoAccept -ResourceDelegates "DelegateName" -AllBookInPolicy:$false -AllRequestInPolicy:$true

The theory is bascially the same in Exchange 2010 however all of these properties can be set in the Exchange Management Console under the mailbox properties.

The following article in the Microsoft Exchange Team Blog has more details on resource mailboxes:


Exchange Header Firewall

Exchange lists each hop in a message’s transmission in the email header.  This is very helpful for troubleshooting mail flow problems however it also exposes internal server names to the outside world.  If you would like to keep this information from being exposed externally you can implement a feature called Header Firewall on your Internet Send Connector using the following Exchange Management Shell command:

Remove-ADPermission -id "Connector Name" -User "NT Authority\Anonymous Logon" -ExtendedRights Ms-Exch-Send-Headers-Routing

Note that this command should be entered as a single command line string.