Requirements:
To start a PowerShell session:
  • Run c:\program files\microsoft online directory sync\dirsyncconfigshell.psc1,
  • To use an existing PowerShell session load the Directory Synchronization snapin:

  • Add-PSSnapin Coexistence-Configuration

  • Import the Microsoft Online Services Module

  • Import-Module MSOnline

These commands can be added to the PowerShell Profile so that they run automatically: http://msdn.microsoft.com/en-us/library/windows/desktop/bb613488(v=vs.85).aspx