Skip to content

Commit f711120

Browse files
committed
GroupPolicy module Formating updates
1 parent 1c8ec3e commit f711120

27 files changed

+2258
-1267
lines changed

docset/winserver2022-ps/grouppolicy/Backup-GPO.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ This command backs up the GPO with the specified **GUID** in the `contoso.com` d
8080
the operation.
8181

8282
If the domain of the user running the session (or, for startup and shutdown scripts, the computer)
83-
is different from the `contoso.com` domain, a trust must exist between the two domains or the command
84-
fails.
83+
is different from the `contoso.com` domain, a trust must exist between the two domains or the
84+
command fails.
8585

8686
### Example 3: Backup all GPOs in the domain of the user that is running the session
8787

88-
```
88+
```powershell
8989
Backup-Gpo -All -Path "\\Server1\GpoBackups"
9090
```
9191

@@ -158,8 +158,8 @@ If you specify a domain that is different from the domain of the user that is ru
158158
session (or, for a startup or shutdown script, the computer), a trust must exist between that domain
159159
and the domain of the user (or the computer).
160160
161-
You can also refer to Domain by its built-in alias, domain name.
162-
For more information, see [about_Aliases](????????).
161+
You can also refer to Domain by its built-in alias, domain name. For more information, see
162+
[about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases)
163163
164164
```yaml
165165
Type: System.String
@@ -178,11 +178,11 @@ Accept wildcard characters: False
178178
Specifies the GPO to backup by its globally unique identifier (GUID).
179179
The `GUID` uniquely identifies the GPO.
180180

181-
You can also refer to the **Guid** parameter by its built-in alias, **Id**.
182-
For more information, see [about_Aliases](????????????).
181+
You can also refer to the **Guid** parameter by its built-in alias, **Id**. For more information,
182+
see [about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
183183

184184
```yaml
185-
Type: Guid ????????????
185+
Type: Guid
186186
Parameter Sets: BackupOne(GUID)
187187
Aliases: Id
188188
@@ -201,8 +201,8 @@ The display name is not guaranteed to be unique in the domain.
201201
If another GPO with the same display name exists in the domain an error occurs.
202202
You can use the **Guid** parameter to uniquely identify a GPO.
203203

204-
You can also refer to the Name parameter by its built-in alias, **DisplayName**.
205-
For more information, see [about_Aliases](??????????????).
204+
You can also refer to the Name parameter by its built-in alias, **DisplayName**. For more
205+
information, see [about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
206206

207207
```yaml
208208
Type: System.String

docset/winserver2022-ps/grouppolicy/Copy-GPO.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,31 +92,32 @@ that is running the session.a trust must exist between that domain and the domai
9292
```powershell
9393
Get-GPO -All -Domain "sales1.contoso.com" | ForEach-Object {
9494
$params = @{
95-
'TargetName' = $_.DisplayName
95+
'TargetName' = $_.DisplayName
96+
'TargetDomain' = "sales2.contoso.com"
97+
'CopyACL' = $true
98+
'MigrationTable' = 'c:\tables\MigrationTable.migtable'
9699
}
97-
98-
??????????????????????
99-
100-
$_ | Copy-GPO -TargetName ($_.DisplayName) -TargetDomain "sales2.contoso.com" -CopyAcl -MigrationTable 'c:\tables\MigrationTable.migtable' }
100+
$_ | Copy-GPO @params }
101101
```
102102

103-
This command copies all the GPOs in the sales1.contoso.com domain to the sales2.contoso.com domain.
103+
This command copies all the GPOs in the `sales1.contoso.com` domain to the `sales2.contoso.com`
104+
domain.
104105

105106
All the GPOs in the source domain are retrieved by using the **Get-GPO** cmdlet using the **All**
106107
parameter. The output of **Get-GPO** is piped into the ForEach-Object command. When each GPO is
107108
evaluated, it is piped into **Copy-GPO** and its display name is specified for the **TargetName**
108-
parameter `-TargetName ($_.DisplayName)`. The **CopyACL** parameter is specified to copy the ACLs for
109-
each GPO to the destination domain. The **MigrationTable** parameter specifies a migration table to
110-
use to migrate Security principals and UNC paths to the destination domain. Both the **CopyACL** and
111-
the **MigrationTable** parameters are optional.
109+
parameter `-TargetName ($_.DisplayName)`. The **CopyACL** parameter is specified to copy the ACLs
110+
for each GPO to the destination domain. The **MigrationTable** parameter specifies a migration table
111+
to use to migrate Security principals and UNC paths to the destination domain. Both the **CopyACL**
112+
and the **MigrationTable** parameters are optional.
112113

113114
If a GPO with the same display name as a source GPO already exists in the destination domain, an
114115
error occurs when this command attempts to copy the source GPO. Because this command copies all GPOs
115116
in the source domain, errors occur for default GPOs; for instance, the Default Domain Policy GPO and
116117
the Default Domain Controllers Policy GPO. These GPOs are not copied. You can suppress these error
117118
messages by supplying the **ErrorAction** parameter with a value of SilentlyContinue to
118119
**Copy-GPO**. For more information about the **ErrorAction** parameter, see
119-
[about_CommonParameters](?????????).
120+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
120121

121122
The destination GPOs that were successfully copied are returned by this command. By default, they
122123
are printed to the display, but you can add commands to the end of the pipeline to further configure
@@ -232,8 +233,8 @@ Accept wildcard characters: False
232233

233234
### -SourceGuid
234235

235-
Specifies the source GPO by its globally unique identifier `GUID`. The `GUID` uniquely identifies the
236-
GPO.
236+
Specifies the source GPO by its globally unique identifier `GUID`. The `GUID` uniquely identifies
237+
the GPO.
237238

238239
You can also refer to the **SourceGuid** parameter by its built-in alias, `Id`.
239240

docset/winserver2022-ps/grouppolicy/Get-GPInheritance.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,12 @@ InheritedGpoLinks : {Default Domain Policy}
9191
This command gets Group Policy inheritance information for the `contoso.com` domain. The domain
9292
controller with the host name `DomainController1` is contacted to complete the operation.
9393

94-
The domain does not have to be explicitly specified using the **Domain** parameter in this example. If
95-
the domain of the user that is running the session (or, for startup and shutdown scripts, the
94+
The domain does not have to be explicitly specified using the **Domain** parameter in this example.
95+
If the domain of the user that is running the session (or, for startup and shutdown scripts, the
9696
computer) is the same as the target domain, or a trust exists between it and the target domain, you
9797
do not have to specify the **Domain** parameter.
9898

99-
### Example 3: Get GPOs that are linked to a specific organizational unit by evaluating the SOM
100-
object
99+
### Example 3: Get GPOs that are linked to a specific organizational unit by evaluating the SOM object
101100

102101
```powershell
103102
(Get-GPInheritance -Target "ou=myou,dc=contoso,dc=com").GpoLinks |
@@ -132,7 +131,7 @@ WmiFilter :
132131
```
133132

134133
This command evaluates the SOM object `Microsoft.GroupPolicy.SOM` returned by **Get-GPInheritance**
135-
and returns the GPOs that are linked to the MyOU organizational unit. You can use this command to
134+
and returns the GPOs that are linked to the `MyOU` organizational unit. You can use this command to
136135
set properties of the GPOs by piping its output into other cmdlets. For instance, you can pipe the
137136
output to the **Set-GPPermissions** cmdlet to delegate permissions to administrators of the OU for
138137
each of the GPOs linked to the OU.
@@ -141,12 +140,14 @@ The **GpoLinks** property of the SOM object contains a list of all the GPO links
141140
Each object in this list is of type `Microsoft.GroupPolicy.GpoLink`.
142141
The following shows one such object:
143142

143+
```Output
144144
GpoId : d02126d4-82e8-4e87-b4a0-2d44b6891411
145145
DisplayName : TestGPO-3
146146
Enabled : True
147147
Enforced : False
148148
Target : ou=myou,dc=contoso,dc=com
149149
Order : 1
150+
```
150151

151152
The collection is piped into a foreach-object command, which retrieves each GPO by using the
152153
DisplayName property of the GpoLink object.
@@ -171,7 +172,7 @@ session (or, for a startup or shutdown script, the computer), a trust must exist
171172
and the domain of the user or the computer.
172173

173174
You can also refer to the **Domain** parameter by its built-in alias, `DomainName`. For more
174-
information, see [about_Aliases](???????).
175+
information, see [about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
175176

176177
```yaml
177178
Type: System.String

docset/winserver2022-ps/grouppolicy/Get-GPO.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ The **Get-GPO** cmdlet gets one Group Policy Object (GPO) or all the GPOs in a d
4040
specify a GPO by its display name or by its globally unique identifier (GUID) to get a single GPO,
4141
or you can get all the GPOs in the domain through the **All** parameter.
4242

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
45+
**Get-GPO** cmdlet to other Group Policy cmdlets.
4546

4647
## EXAMPLES
4748

@@ -65,9 +66,9 @@ ComputerVersion : AD Version: 0, SysVol Version: 0
6566
WmiFilter :
6667
```
6768

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).
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).
7172

7273
### Example 2: Get a single GPO by GUID
7374

@@ -90,9 +91,9 @@ WmiFilter :
9091
```
9192

9293
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
9697
`sales.contoso.com` domain).
9798

9899
### 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
132133
session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain
133134
of the computer is used. For more information, see the Notes section in the full Help.
134135
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.
136139
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).
139142
140143
```yaml
141144
Type: System.String
@@ -237,19 +240,23 @@ This cmdlet returns an object that represents the requested GPO.
237240
238241
* You can use the **Domain** parameter to explicitly specify the domain for this cmdlet.
239242
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.
253260
254261
## RELATED LINKS
255262

docset/winserver2022-ps/grouppolicy/Get-GPOReport.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ This command generates a report in HTML format for the GPO `TestGPO1` and writes
6363
### Example 2: Generate an XML report for each GPO in the specified domain
6464

6565
```powershell
66-
Get-GPOReport -All -Domain "sales.contoso.com" -Server "DC1" -ReportType XML -Path "C:\GPOReports\GPOReportsAll.xml"
66+
$params = @{
67+
All = $true
68+
Domain = 'sales.contoso.com'
69+
Server = 'DC1'
70+
ReportType = 'XML'
71+
Path = 'C:\GPOReports\GPOReportsAll.xml'
72+
}
73+
Get-GPOReport @params
6774
```
6875

6976
This command generates a report in XML format for each GPO in the `sales.contoso.com` domain and
@@ -120,7 +127,7 @@ session or, (for a startup or shutdown script, the computer), a trust must exist
120127
and the domain of the user or the computer.
121128
122129
You can also refer to Domain by its built-in alias, **DomainName**. For more information, see
123-
[about_Aliases](????????????).
130+
[about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
124131
125132
```yaml
126133
Type: System.String
@@ -139,8 +146,8 @@ Accept wildcard characters: False
139146
Specifies the GPO for which to generate the report by its globally unique identifier (GUID). The
140147
GUID uniquely identifies the GPO.
141148
142-
You can also refer to the **Guid** parameter by its built-in alias, **Id**.
143-
For more information, see [about_Aliases](????????).
149+
You can also refer to the **Guid** parameter by its built-in alias, **Id**. For more information,
150+
see [about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases)
144151
145152
```yaml
146153
Type: Guid
@@ -162,8 +169,8 @@ The display name is not guaranteed to be unique in the domain. If another GPO wi
162169
name exists in the domain an error occurs. You can use the **Guid** parameter to uniquely identify a
163170
GPO.
164171
165-
You can also refer to the **Name** parameter by its built-in alias, **DisplayName**.
166-
For more information, see [about_Aliases](????????).
172+
You can also refer to the **Name** parameter by its built-in alias, **DisplayName**. For more
173+
information, see [about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
167174
168175
```yaml
169176
Type: System.String
@@ -224,7 +231,7 @@ If you do not specify the name by using the **Server** parameter, the primary do
224231
(PDC) emulator is contacted.
225232

226233
You can refer to this parameter by its built-in alias, **DC**. For more information, see
227-
[about_Aliases](????????).
234+
[about_Aliases](/powershell/module/microsoft.powershell.core/about/about_aliases).
228235

229236
```yaml
230237
Type: System.String
@@ -281,4 +288,3 @@ This cmdlet does not generate any output.
281288
startup or shutdown scripts, the computer account, a trust must exist between the two domains.
282289

283290
## RELATED LINKS
284-

0 commit comments

Comments
 (0)