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
Copy file name to clipboardExpand all lines: docset/winserver2022-ps/grouppolicy/Get-GPO.md
+31-24Lines changed: 31 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,8 +40,9 @@ The **Get-GPO** cmdlet gets one Group Policy Object (GPO) or all the GPOs in a d
40
40
specify a GPO by its display name or by its globally unique identifier (GUID) to get a single GPO,
41
41
or you can get all the GPOs in the domain through the **All** parameter.
42
42
43
-
This cmdlet returns one or more objects that represent the requested GPOs.
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.
43
+
This cmdlet returns one or more objects that represent the requested GPOs. By default, properties of
44
+
the requested GPOs are printed to the display; however, you can also pipe the output of the
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).
69
+
This command gets the GPO named `Group Policy Test`. The GPO must exist in the domain of the user
70
+
that is running the session (or, for startup and shutdown scripts, the computer). The command gets
71
+
the GPO information by contacting the primary domain controller (PDC).
71
72
72
73
### Example 2: Get a single GPO by GUID
73
74
@@ -90,9 +91,9 @@ WmiFilter :
90
91
```
91
92
92
93
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
94
+
`sales.contoso.com` domain. If the domain of the user that is running the session (or, for startup
95
+
and shutdown scripts, the computer) is different that `sales.contoso.com`, a trust must exist
96
+
between the two domains. The command retrieves the GPO information by contacting the PDC (in the
96
97
`sales.contoso.com` domain).
97
98
98
99
### Example 3: Get all GPOs from a domain
@@ -132,10 +133,12 @@ If you do not specify the **Domain** parameter, the domain of the user that is r
132
133
session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain
133
134
of the computer is used. For more information, see the Notes section in the full Help.
134
135
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.
136
+
If you specify a domain that is different from the domain of the user that is running the current
137
+
session (or, for a startup or shutdown script, the computer), a trust must exist between that domain
138
+
and the domain of the user or the computer.
136
139
137
-
You can also refer to the **Domain** parameter by its built-in alias, **DomainName**.
138
-
For more information, see [about_Aliases](????????????).
140
+
You can also refer to the **Domain** parameter by its built-in alias, **DomainName**. For more
141
+
information, see [about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
139
142
140
143
```yaml
141
144
Type: System.String
@@ -237,19 +240,23 @@ This cmdlet returns an object that represents the requested GPO.
237
240
238
241
* You can use the **Domain** parameter to explicitly specify the domain for this cmdlet.
239
242
240
-
If you do not explicitly specify the domain, the cmdlet uses a default domain.
241
-
The default domain is the domain that is used to access network resources by the security context under which the current session is running.
242
-
This domain is typically the domain of the user that is running the session.
243
-
For example, the domain of the user who started the session by opening Windows PowerShell from the Program Files menu, or the domain of a user that is specified in a runas command.
244
-
However, computer startup and shutdown scripts run under the context of the LocalSystem account.
245
-
The LocalSystem account is a built-in local account, and it accesses network resources under the context of the computer account.
246
-
Therefore, when this cmdlet is run from a startup or shutdown script, the default domain is the domain to which the computer is joined.
247
-
248
-
Only one domain can be used by an instance of this cmdlet.
249
-
If you pipe a collection of GPO (Microsoft.GroupPolicy.Gpo) objects to this cmdlet, the DomainName property of the first GPO object in the collection specifies the domain for the cmdlet.
250
-
This is because domainname is a built-in alias for the **Domain** parameter, and the **Domain** parameter can take its value by property name from the pipeline.
251
-
A non-terminating error occurs for any GPOs in the collection that are not in this domain.
252
-
If this domain is different from the domain of the user account (for startup or shutdown scripts, the computer account), a trust must exist between the two domains.
243
+
If you do not explicitly specify the domain, the cmdlet uses a default domain. The default domain
244
+
is the domain that is used to access network resources by the security context under which the
245
+
current session is running. This domain is typically the domain of the user that is running the
246
+
session. For example, the domain of the user who started the session by opening Windows PowerShell
247
+
from the Program Files menu, or the domain of a user that is specified in a runas command.
248
+
However, computer startup and shutdown scripts run under the context of the LocalSystem account.
249
+
The LocalSystem account is a built-in local account, and it accesses network resources under the
250
+
context of the computer account. Therefore, when this cmdlet is run from a startup or shutdown
251
+
script, the default domain is the domain to which the computer is joined.
252
+
253
+
Only one domain can be used by an instance of this cmdlet. If you pipe a collection of GPO
254
+
(Microsoft.GroupPolicy.Gpo) objects to this cmdlet, the DomainName property of the first GPO
255
+
object in the collection specifies the domain for the cmdlet. This is because domainname is a
256
+
built-in alias for the **Domain** parameter, and the **Domain** parameter can take its value by
257
+
property name from the pipeline. A non-terminating error occurs for any GPOs in the collection
258
+
that are not in this domain. If this domain is different from the domain of the user account (for
259
+
startup or shutdown scripts, the computer account), a trust must exist between the two domains.
0 commit comments