Powershell to set GPO

Go To StackoverFlow.com

0

I want to set the value of "Inclusion list for Moderate risk file Types" to enable and add a file extension to the list. The key exists in :

User Configuration>Administrative Templates>Windows Components>Attachment Manager

How can I use powershell to turn this on and off ?

2012-04-05 01:50
by Jake K


1

To create a GPO based on a registry key on a W2K8 R2 computer, the roadmap is the following

Import the Active-Directory module :

Import-module activeDirectory

Create a GPO and link it to an OU :

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

Create the registry value :

Set-GPPrefRegistryValue -Name "MyGPO" -Context User -Action Create -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MyClef" -ValueName Value1 -Value Value2 -Type string
2012-04-05 03:33
by JPBlanc
Thanks JPBlanc...I'll give that a shot and report bac - Jake K 2012-04-05 03:37
It appears that the activeDirectory module requires the AD roles enabled on the server. So I ended up not going the GPO route and instead made changes to the registry via powershell. New-ItemProperty -name ModRiskFileTypes -propertyType string HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Associations -value "*.exe" And to Remove Remove-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Associations ModRiskFileType - Jake K 2012-04-05 20:40
Ads