Powershell用于设置GPO

Powershell用于设置GPO,powershell,active-directory,powershell-2.0,gpo,Powershell,Active Directory,Powershell 2.0,Gpo,我想设置“中等风险文件类型的包含列表”的值,以启用并向列表中添加文件扩展名。关键在于: User Configuration>Administrative Templates>Windows Components>Attachment Manager 如何使用powershell打开和关闭此功能?要在W2K8 R2计算机上基于注册表项创建GPO,路线图如下所示 导入Active Directory模块: 导入模块activeDirectory 创建GPO并将其链接到OU: N

我想设置“中等风险文件类型的包含列表”的值,以启用并向列表中添加文件扩展名。关键在于:

User Configuration>Administrative Templates>Windows Components>Attachment Manager

如何使用powershell打开和关闭此功能?

要在W2K8 R2计算机上基于注册表项创建GPO,路线图如下所示

导入Active Directory模块:

导入模块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

谢谢JPBlanc…我将对此进行一次拍摄并报告,activeDirectory模块似乎需要在服务器上启用AD角色。因此,我最终没有走GPO路线,而是通过powershell对注册表进行了更改。新建ItemProperty-名称ModRiskFileTypes-propertyType字符串HKCU:\Software\Microsoft\Windows\CurrentVersion\Policys\Associations-值“*.exe”,并删除ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Policys\Associations ModRiskFileTypes