You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **Get-GPO** cmdlet gets one Group Policy Object (GPO) or all the GPOs in a domain.
35
-
You can specify a GPO by its display name or by its globally unique identifier (GUID) to get a single GPO, or you can get all the GPOs in the domain through the *All* parameter.
38
+
39
+
The **Get-GPO** cmdlet gets one Group Policy Object (GPO) or all the GPOs in a domain. You can
40
+
specify a GPO by its display name or by its globally unique identifier (GUID) to get a single GPO,
41
+
or you can get all the GPOs in the domain through the **All** parameter.
36
42
37
43
This cmdlet returns one or more objects that represent the requested GPOs.
38
44
By default, properties of the requested GPOs are printed to the display; however, you can also pipe the output of the **Get-GPO** cmdlet to other Group Policy cmdlets.
39
45
40
46
## EXAMPLES
41
47
42
48
### Example 1: Get a single GPO from a domain
43
-
```
44
-
PS C:\> Get-GPO -Name "Group Policy Test"
45
-
DisplayName : Group Policy Test
46
-
47
-
DomainName : contoso.com
48
-
49
-
Owner : CONTOSO\Domain Admins
50
-
51
-
Id : 31a09564-cd4a-4520-98fa-446a2af23b4b
52
49
53
-
GpoStatus : AllSettingsEnabled
50
+
```powershell
51
+
Get-GPO -Name "Group Policy Test"
52
+
```
54
53
54
+
```Output
55
+
DisplayName : Group Policy Test
56
+
DomainName : contoso.com
57
+
Owner : CONTOSO\Domain Admins
58
+
Id : 31a09564-cd4a-4520-98fa-446a2af23b4b
59
+
GpoStatus : AllSettingsEnabled
55
60
Description :
56
-
57
-
CreationTime : 2/26/2009 12:15:42 AM
58
-
59
-
ModificationTime : 2/26/2009 12:15:42 AM
60
-
61
-
UserVersion : AD Version: 0, SysVol Version: 0
62
-
63
-
ComputerVersion : AD Version: 0, SysVol Version: 0
64
-
61
+
CreationTime : 2/26/2009 12:15:42 AM
62
+
ModificationTime : 2/26/2009 12:15:42 AM
63
+
UserVersion : AD Version: 0, SysVol Version: 0
64
+
ComputerVersion : AD Version: 0, SysVol Version: 0
65
65
WmiFilter :
66
66
```
67
67
68
-
This command gets the GPO named Group Policy Test.
69
-
The GPO must exist in the domain of the user that is running the session (or, for startup and shutdown scripts, the computer).
70
-
The command gets the GPO information by contacting the primary domain controller (PDC).
68
+
This command gets the GPO named `Group Policy Test`. The GPO must exist in the domain of the user that
69
+
is running the session (or, for startup and shutdown scripts, the computer). The command gets the
70
+
GPO information by contacting the primary domain controller (PDC).
ComputerVersion : AD Version: 0, SysVol Version: 0
95
89
WmiFilter :
96
90
```
97
91
98
-
This command gets the GPO that has the ID (GUID) 331a09564-cd4a-4520-98fa-446a2af23b4b in the sales.contoso.com domain.
99
-
If the domain of the user that is running the session (or, for startup and shutdown scripts, the computer) is different that sales.contoso.com, a trust must exist between the two domains.
100
-
The command retrieves the GPO information by contacting the PDC (in the sales.contoso.com domain).
92
+
This command gets the GPO that has the ID (GUID) `331a09564-cd4a-4520-98fa-446a2af23b4b` in the
93
+
`sales.contoso.com` domain. If the domain of the user that is running the session (or, for startup and
94
+
shutdown scripts, the computer) is different that `sales.contoso.com`, a trust must exist between the
95
+
two domains. The command retrieves the GPO information by contacting the PDC (in the
96
+
`sales.contoso.com` domain).
101
97
102
98
### Example 3: Get all GPOs from a domain
103
-
```
104
-
PS C:\> Get-GPO -All -Domain "sales.contoso.com"
99
+
100
+
```powershell
101
+
Get-GPO -All -Domain "sales.contoso.com"
105
102
```
106
103
107
-
This command get all the GPOs in the sales.contoso.com domain.
104
+
This command get all the GPOs in the `sales.contoso.com` domain.
108
105
109
106
## PARAMETERS
110
107
111
108
### -All
109
+
112
110
Indicates that the cmdlet gets all the GPOs in the domain.
You must specify the fully qualified domain name (FQDN) of the domain.
125
+
126
+
Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the
127
+
domain.
129
128
130
129
For the **Get-GPO** cmdlet, the GPO (or GPOs) to that this cmdlet gets must exist in this domain.
131
130
132
-
If you do not specify the *Domain* parameter, the domain of the user that is running the current session is used.
133
-
If the cmdlet is being run from a computer startup or shutdown script, the domain of the computer is used.
134
-
For more information, see the Notes section in the full Help.
131
+
If you do not specify the **Domain** parameter, the domain of the user that is running the current
132
+
session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain
133
+
of the computer is used. For more information, see the Notes section in the full Help.
135
134
136
135
If you specify a domain that is different from the domain of the user that is running the current session (or, for a startup or shutdown script, the computer), a trust must exist between that domain and the domain of the user or the computer.
137
136
138
-
You can also refer to the *Domain* parameter by its built-in alias, domainname.
139
-
For more information, see about_Aliases.
137
+
You can also refer to the **Domain** parameter by its built-in alias, **DomainName**.
138
+
For more information, see [about_Aliases](????????????).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
216
+
217
+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
@@ -101,11 +101,11 @@ For more information, see the Notes section in the full Help.
101
101
102
102
If you specify a domain that is different from the domain of the user that is running the current session or, (for a startup or shutdown script, the computer), a trust must exist between that domain and the domain of the user or the computer.
103
103
104
-
You can also refer to Domain by its built-in alias, domainname.
105
-
For more information, see about_Aliases.
104
+
You can also refer to Domain by its built-in alias, **DomainName**.
105
+
For more information, see [about_Aliases](????????????).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
219
220
220
221
## INPUTS
@@ -229,6 +230,7 @@ Collections that contain GPOs from different domains are not supported.
229
230
This cmdlet does not generate any output.
230
231
231
232
## NOTES
233
+
232
234
* You can use the *Domain* parameter to explicitly specify the domain for this cmdlet.
233
235
234
236
If you do not explicitly specify the domain, the cmdlet uses a default domain.
0 commit comments