Get-PSGPOInheritance¶
The GPOs linked to the domain or to an OU, and those that apply there by inheritance, as the Linked Group Policy Objects and Group Policy Inheritance tabs of GPMC (Get-GPInheritance).
The help of the command, as Get-Help Get-PSGPOInheritance -Full gives it.
Syntax¶
Get-PSGPOInheritance [-Target] <string[]> [[-Directory] <GPOToolsDirectory>] [[-Server] <string>] [<CommonParameters>]
Description¶
One object per domain or OU: Name, ContainerType (Domain, OrganizationalUnit), Path (its distinguished name), GpoInheritanceBlocked, and:
- GpoLinks: the links of the domain or OU, by link order (1 wins): Order, DisplayName, GpoId, Enabled, Enforced, Target;
- InheritedGpoLinks: the GPOs that apply there, by precedence (1 wins), as the Group Policy Inheritance tab lists them: first the enforced links, from the domain down (the one nearest the domain wins), then the other links, from the domain or OU up to the domain, until an OU that blocks the inheritance (its own links included). Precedence, DisplayName, GpoId, Enforced, Status (a GPO whose settings are all disabled is listed with it), Target (where it is linked). The disabled links are left out.
The security filtering and the WMI filters, which depend on each computer or user, are not taken into account; neither are the links of the sites.
Parameters¶
-Target¶
The domain or the OU: its distinguished name, the name of the domain, or the name of an OU when only one OU has it.
| Type | Required | Position | Default value | Accepts pipeline input |
|---|---|---|---|---|
String[] |
Yes | 1 | None | Yes |
-Directory¶
Directory of the domain (Get-PSGPODirectory); the domain is read when not given.
| Type | Required | Position | Default value | Accepts pipeline input |
|---|---|---|---|---|
GPOToolsDirectory |
No | 2 | None | No |
-Server¶
Domain controller to read the domain from, without -Directory.
| Type | Required | Position | Default value | Accepts pipeline input |
|---|---|---|---|---|
String |
No | 3 | None | No |
Examples¶
Example 1¶
(Get-PSGPOInheritance -Target 'OU=Workstations,OU=Tier 2,DC=contoso,DC=com').InheritedGpoLinks | Format-Table Precedence, DisplayName, Enforced, Target
Example 2¶
Outputs¶
PSGPOTools.GpoInheritance