I have been given the task of writing Powershell scripts to set up a server from scratch to run one of our services as part of a web application, and one of the steps required for setting this server up is changing the DCOM config for the installed service, specifically adding accounts to the “Launch and Activation”/”Access” Permissions and also set the permissions for these accounts once they have been added.
Is there a method of doing this using Powershell at all? I haven’t been able to find a concrete method of doing what I’m aiming to achieve so any help would be great
Looks like you would do it using WMI.
Get an instance of:
Win32_DCOMApplicationSettinglike this:Now you have access to the
SetAccessSecurityDescriptorandSetLaunchSecurityDescriptormethods.From: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384905(v=vs.85).aspx
There’s also a tool called DCOMPERM in which source code is available in the Windows SDK: http://www.microsoft.com/en-us/download/details.aspx?id=8279
You can find compiled versions around online if you search for DCOMPERM compiled.
Here are the command line options: