株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

全OUをなめて、それに紐づくGPOを一覧化して、Remove-GPLinkに渡してます。
Default Domain PolicyとDefault Domain Controllers Policyは外すと怒られるので除外しています。
別に外そうとしても外れないと思うけど。Default Domain Controllers Policyは外せたような気がする

Get-ADOrganizationalUnit -Filter 'Name -like "*"'| %{Get-GPInheritance -target $_} | %{$_.gpolinks}   | ?{$_.DisplayName -notmatch "Default Domain Policy|Default Domain Controllers Policy"} | %{Remove-GPLink -Guid $_.gpoid -Target $_.target}

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)