Monday, February 23, 2015

Install and Remove AAD Sync

Been doing some automation around AAD Sync lately and find it convenient to start from scratch without throwing away the whole machine.  In that case I just uninstall AAD Sync, then re-install.

In each case I’m just calling msiexec.exe with the command line options.  The only secret sauce is in the MSI parameters; dug those out of the MSI using Orca.

Here’s the script snippets:

Start-Process -FilePath msiexec.exe -Wait -ArgumentList @(

'/q'

'/x "C:\InstallationFiles\AADSync\Synchronization Service.msi"'

)

 

Invoke-Sqlcmd -Query "DROP DATABASE ADSync" -Verbose

 

Start-Process -FilePath msiexec.exe -Wait -ArgumentList @(

'/q'

'/i "C:\InstallationFiles\AADSync\Synchronization Service.msi"'

'/lv* C:\Temp\SynchronizationService.log'

'SQLServerStore=LocalMachine'

'SQLServerInstance=DefaultInstance'

'SQLDB=ADSync'

'GROUPADMINS=AADSyncAdmins'

'GROUPBROWSE=AADSyncBrowsers'

'GROUPOPERATORS=AADSyncOperators'

'GROUPPASSWORDSET=AADSyncPasswordReset'

'SERVICEACCOUNT=administrator'

'SERVICEPASSWORD=HOOFHEARTED'

'SERVICEDOMAIN=ICEMELTED'

'ACCEPT_EULA=1'

'REBOOT=ReallySuppress'

)

 

UPDATE - March 2, 2014: had a conversation with an authoritative source about this approach and it turns out to be not very useful.  The AAD Sync wizard does a lot of work, and bypassing it has the potential to break a deployment when AAD Sync gets updated.  The DevOps nerd in me protests any wizard getting in the way of automating a system, but all is not lost since the wizard can be automated with an answer file.  More on that later.

No comments: