Tuesday, October 14, 2014

WAAD DirSync - Broken PowerShell

As widely documented, to manually start the Windows Azure Active Directory DirSync (installed as part of the Office 365 deployment), the following PowerShell commands are issued:

Import-Module DirSync
Start-OnlineCoexistenceSync

Sources:
http://blogs.technet.com/b/rmilne/archive/2014/10/01/how-to-run-manual-dirsync-_2f00_-azure-active-directory-sync-updates.aspx

http://technet.microsoft.com/en-us/library/jj151771.aspx

The only trouble is that, when I tried running the PowerShell command "Import-Module DirSync" on my WAAD DirSync server, I get the following error message!


The message says:
Get-Item : Cannot find path 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence' because it does not exist.

The trouble is, the registry does exist, as proven here:

So what I have done to fix it is:


  1. Navigate to your WAAD DirSync install path, typically "C:\Program Files\Windows Azure Active Directory Sync\DirSync\"
  2. In there, there should be a file named "ImportModules.ps1"
  3. Open the file and replace the second line with "$DirSyncInstallPath = "C:\Program Files\Windows Azure Active Directory Sync\"
  4. Save the file, and now you can run "Import-Module DirSync" with no problems.
The resultant file should look like the following (ignore the filename in the picture, it should named  ImportModules.ps1):


No comments: