あなたはWMIを使っているようです。このようなWin32_DCOMApplicationSetting
:
はのインスタンスを取得します
$dcom = Get-WMIObject -Class Win32_DCOMApplicationSetting -Filter 'Description="Something"'
今、あなたはSetAccessSecurityDescriptor
とSetLaunchSecurityDescriptor
メソッドへのアクセス権を持っています。
:http://msdn.microsoft.com/en-us/library/windows/desktop/aa384905(v=vs.85).aspx
DCOMアプリケーション
DCOMアプリケーション・インスタンスは、いくつかのセキュリティ記述子を持っています。 Windows Vistaで を起動するには、Win32_DCOMApplicationSetting クラスのメソッドを使用して、さまざまなセキュリティ記述子を取得または変更します。セキュリティ 記述子は、Win32_SecurityDescriptor クラスのインスタンスとして返されます。
構成のアクセス許可を取得または変更するには、 GetConfigurationSecurityDescriptorまたは SetConfigurationSecurityDescriptorメソッドを呼び出します。
アクセス許可を取得または変更するには、 GetAccessSecurityDescriptorまたはSetAccessSecurityDescriptorメソッドを呼び出します。
起動とアクティベーションのアクセス許可を取得または変更するには、 GetLaunchSecurityDescriptorメソッドまたはSetLaunchSecurityDescriptorメソッドを呼び出します。
Windows Server 2003、Windows XP、Windows 2000、Windows NT 4.0、および Windows Me/98/95:Win32_DCOMApplicationSettingセキュリティ 記述子メソッドは使用できません。
ソースコードは、Windows SDKで提供されているDCOMPERMというツールもあります:http://www.microsoft.com/en-us/download/details.aspx?id=8279
あなたがコンパイルDCOMPERMを探している場合は、オンラインの周りにコンパイルされたバージョンを見つけることができます。ここで
は、コマンドラインオプションは次のとおりです。
Syntax: dcomperm <option> [...]
Options:
Modify or list the machine access permission list
-ma <"set" or "remove"> <Principal Name> ["permit" or "deny"] ["level:l,r"]
-ma list
Modify or list the machine launch permission list
-ml <"set" or "remove"> <Principal Name> ["permit" or "deny"] ["level:l,r,ll,la,rl,ra"]
-ml list
Modify or list the default access permission list
-da <"set" or "remove"> <Principal Name> ["permit" or "deny"] ["level:l,r"]
-da list
Modify or list the default launch permission list
-dl <"set" or "remove"> <Principal Name> ["permit" or "deny"] ["level:l,r,ll,la,rl,ra"]
-dl list
Modify or list the access permission list for a specific AppID
-aa <AppID> <"set" or "remove"> <Principal Name> ["permit" or "deny"] ["level:l,r"]
-aa <AppID> default
-aa <AppID> list
Modify or list the launch permission list for a specific AppID
-al <AppID> <"set" or "remove"> <Principal Name> ["permit" or "deny"] ["level:l,r,ll,la,rl,ra"]
-al <AppID> default
-al <AppID> list
level:
ll - local launch (only applies to {ml, dl, al} options)
rl - remote launch (only applies to {ml, dl, al} options)
la - local activate (only applies to {ml, dl, al} options)
ra - remote activate (only applies to {ml, dl, al} options)
l - local (local access - means launch and activate when used with {ml, dl, al} options)
r - remote (remote access - means launch and activate when used with {ml, dl, al} options)
ありがとう、アンディー、それは多くの助けになりました!最後に私は両方の方法の混合を使用しました。 Win32_DCOMApplicationSettingを使用してアプリケーションIDを取得した後、DComPermを使用して必要なアクセス許可を追加しました。私が少し奇妙なことに気がついたのは、CMDがPowershellよりも問題の少ないDcomPermを実行していたため、私は必要なものを達成するために、特定の変数が渡されたバッチファイルを書き、Powershellから呼び出しました。 – Vermin
@Vermin私の推測ではPowerShellの問題はおそらく構文/コマンドラインの解析に関連すると思われます。たぶんあなたが持っているエラーを投稿しますか? –