Partage
  • Partager sur Facebook
  • Partager sur Twitter

Appliquer une GPO à un utilisateur

Utilisation New-GPLink

Sujet résolu
    28 février 2019 à 15:17:12

    I have written a script that allows me to link a GPO to an OU,but I want to be more specific and link it to a known user 
    Below is the code that I've written
    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'

    -
    Edité par MohamedKhalilHannachi 28 février 2019 à 15:24:01

    • Partager sur Facebook
    • Partager sur Twitter
      28 février 2019 à 18:18:49

      GPO needs to be applied to the OU and the users need to be member of the OU. By default GPO is filtered to Authenticated Users. If you want to apply the GPO to specific users within an OU, I would create an AD Group, add users to the group, remove Authenticated users from the Security Filtering and finally Apply the AD Group to the GPO Security Filtering.

      I have never used GPO PowerShell commands, but I would probably try Set-GPPermissions

      • Partager sur Facebook
      • Partager sur Twitter

      Appliquer une GPO à un utilisateur

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown