Silent install of SQL Diagnostic Manager Console

For the longest time I have been wanting to automate the install of SQLDM console so when I update SQLDM itself I don't have to go to all our users workstations and manually upgrade it by hand. I have made attempt to automate it in the past and have ran into issues non detailed documentation on the Idera site and a number of blog posts of other using trying to do the same thing with little luck. That said I took the time to get something usable over the last 24 hours and wanted to share it in case someone else attempts to do this and is looking for resources. 

1) You need to have the perquisites in place for the console before you attempt to automate the install because the CLI as far as I know does not have a setting you can add to auto install any missing requirements during the install like you might see when installing via the GUI. Here is a link to the page that lists all the requirements:
http://wiki.idera.com/display/SQLDM/SQL+Diagnostic+Manager+requirements - Just look for the "SQL Diagnostic Manager Services" section

As of writing this the requirement was to have .Net 4.7.2 runtime installed and it also listed MDAC 2.8 but if you are running Windows 10 I don't think you need to worry about that one being missing (have not fully tested that yet though). I suggest getting a test box you can snapshot and and restore over and over for testing to verify and just run the GUI install to see what is missing. I will not go into detail on how you should go about deploying any perquisites as that may differ form shop to shop.

2) Command to install the SQLDM console. The site does have documentation on it but it is limited and provides no detail on what .exe to use and what each command switch does and if it is required. Here is the link to that documentation: 

http://wiki.idera.com/display/SQLDM101/Install+SQL+Diagnostic+Manager+in+silent+mode

FYI you should use the SQLDiagnosticManager-x64_c.exe found in the SQLdm x64 Installation KIT folder found here "c:\Program Files\Idera\SQLdm x64 Installation Kit\x64\SQLDiagnosticManager-x64_c.exe"

This is the command I use to do the actual install if I was going to point to the install kit files on the SQLDM server:
"\\SQLdmServerNameHere\c$\Program Files\Idera\SQLdm x64 Installation Kit\x64\SQLDiagnosticManager-x64_c.exe" /v"/L*v C:\Windows\Temp\IderaSDMInstall.log SETUPTYPE="Console" /quiet"

3) Last you should do one clean up task where SQLDM requires you to update the registry the first time you run the console when you point the console to the SQLDM database repository. Once you do that initial configuration you will get the error if you do not run the console admin:
"Access to the registry key 'HKEY_LOCAL_MACHINE\Software\Idera\SQLdm' is denied (mscorlib)"

To get around running it as admin for any user that opens the console for the first time you will need to give the 'BUILTIN\users' group 'FULLACCESS' to the registry key to make the update. Here is a PowerShell script I put together to automate this task:
========================================================

$acl = Get-Acl 'HKLM:\Software\Idera\SQLdm'
$idRef = [System.Security.Principal.NTAccount]("BUILTIN\users")
$regRights = [System.Security.AccessControl.RegistryRights]::FullControl
$inhFlags = [System.Security.AccessControl.InheritanceFlags]::None
$prFlags = [System.Security.AccessControl.PropagationFlags]::None
$acType = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule ($idRef, $regRights, $inhFlags, $prFlags, $acType)
$acl.AddAccessRule($rule)
$acl | Set-Acl -Path 'HKLM:\Software\Idera\SQLdm'

========================================================

It is too bad this amount of work is required to do a silent install for a simple app but once you have all of that in place you should have a silent way to automate deploying the console to user workstation. The user will still need to do the initial configuration of pointing to your SQLDM database to connect but that should be it. If anyone knows of a better way to do any of this please comment so this can help others who are googling how to do this.