2012-04-05 114 views
0

我想要設置「中等風險文件類型的包含列表」的值以啓用文件擴展名並將其添加到列表中。關鍵存在於:Powershell設置GPO

User Configuration>Administrative Templates>Windows Components>Attachment Manager 

如何使用powershell打開和關閉此功能?

回答

1

要創建一個基於W2K8 R2的計算機上的註冊表項GPO時,該路線圖是以下

導入Active-Directory模塊:

Import-module activeDirectory

創建一個GPO,並將其鏈接到OU:

New-GPO -Name "MyGPO" | New-GPLink -target "ou=MyOU,dc=silogix,dc=fr" -LinkEnabled Yes" 

創建註冊表值:

Set-GPPrefRegistryValue -Name "MyGPO" -Context User -Action Create -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MyClef" -ValueName Value1 -Value Value2 -Type string 
+0

謝謝JPBlanc ...我會給你一個鏡頭並回報 – 2012-04-05 03:37:21

+0

看來activeDirectory模塊需要在服務器上啓用AD角色。所以我最終不去GPO路線,而是通過PowerShell對註冊表進行更改。 New-ItemProperty -name ModRiskFileTypes -propertyType string HKCU:\ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Associations -value「* .exe」並刪除Remove-ItemProperty HKCU:\ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Associations ModRiskFileTypes – 2012-04-05 20:40:45