【发布时间】:2019-02-28 13:50:38
【问题描述】:
我编写了一个代码,允许我将 GPO 链接到 OU,但我想更具体并将其链接到已知用户。
下面是我写的代码:
Import-Module ActiveDirectory
Import-Module GroupPolicy
$GPOName = 'DisableInternet'
$GPO = New-GPO -Name $GPOName -Domain 'Administrateur.6NLG-AD'
Set-GPPrefRegistryValue -Name $GPOName -Context User -Key 'HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions' -ValueName 'NoBrowserOptions' -Value 1 -Type DWord -Action Create
Set-GPPrefRegistryValue -Name $GPOName -Context User -Key 'HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions' -ValueName 'NoBrowserOptions' -Value 1 -Type DWord -Action Update
Set-GPPrefRegistryValue -Name $GPOName -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -ValueName ProxyServer -Value 0.0.0.0:80 -Type String -Action Create
Set-GPPrefRegistryValue -Name $GPOName -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -ValueName ProxyEnable -Value 1 -Type DWord -Action Create
Set-GPPrefRegistryValue -Name $GPOName -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -ValueName ProxyServer -Value 0.0.0.0:80 -Type String -Action Update
Set-GPPrefRegistryValue -Name $GPOName -Context User -Key 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -ValueName ProxyEnable -Value 1 -Type DWord -Action Update
New-GPLink -Name $GPOName -Target 'OU=Nouvelle_UO,DC=Administrateur,DC=6NLG-AD'
【问题讨论】:
标签: powershell active-directory group-policy