Skip to content

Commit a90bcdf

Browse files
Merge pull request MicrosoftDocs#3409 from RobBiddle/Issue-3408
Quality: PowerShell Summit MicrosoftDocsGH-3408
2 parents 3d98a54 + 4878dc8 commit a90bcdf

File tree

1 file changed

+115
-67
lines changed

1 file changed

+115
-67
lines changed

docset/winserver2022-ps/addsdeployment/Uninstall-ADDSDomainController.md

Lines changed: 115 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,49 @@ Uninstalls a domain controller in Active Directory.
1616
## SYNTAX
1717

1818
### ADDSDomainControllerUninstall (Default)
19+
1920
```
20-
Uninstall-ADDSDomainController [-SkipPreChecks] [-LocalAdministratorPassword <SecureString>]
21-
[-Credential <PSCredential>] [-DemoteOperationMasterRole] [-DnsDelegationRemovalCredential <PSCredential>]
22-
[-IgnoreLastDCInDomainMismatch] [-IgnoreLastDnsServerForZone] [-LastDomainControllerInDomain]
23-
[-NoRebootOnCompletion] [-RemoveApplicationPartitions] [-RemoveDnsDelegation] [-RetainDCMetadata] [-Force]
24-
[-WhatIf] [-Confirm] [<CommonParameters>]
21+
Uninstall-ADDSDomainController [-SkipPreChecks]
22+
[-LocalAdministratorPassword <SecureString>] [-Credential <PSCredential>]
23+
[-DemoteOperationMasterRole] [-DnsDelegationRemovalCredential <PSCredential>]
24+
[-IgnoreLastDCInDomainMismatch] [-IgnoreLastDnsServerForZone]
25+
[-LastDomainControllerInDomain] [-NoRebootOnCompletion] [-RemoveApplicationPartitions]
26+
[-RemoveDnsDelegation] [-RetainDCMetadata] [-Force] [-WhatIf] [-Confirm]
27+
[<CommonParameters>]
2528
```
2629

2730
### ADDSDomainControllerUninstallForceRemoval
31+
2832
```
29-
Uninstall-ADDSDomainController [-SkipPreChecks] [-LocalAdministratorPassword <SecureString>]
30-
[-Credential <PSCredential>] [-DemoteOperationMasterRole] [-ForceRemoval] [-NoRebootOnCompletion] [-Force]
31-
[-WhatIf] [-Confirm] [<CommonParameters>]
33+
Uninstall-ADDSDomainController [-SkipPreChecks]
34+
[-LocalAdministratorPassword <SecureString>]
35+
[-Credential <PSCredential>] [-DemoteOperationMasterRole] [-ForceRemoval]
36+
[-NoRebootOnCompletion] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
3237
```
3338

3439
## DESCRIPTION
35-
The **Uninstall-ADDSDomainController** cmdlet uninstalls a domain controller in Active Directory.
40+
41+
The `Uninstall-ADDSDomainController` cmdlet uninstalls a domain controller in Active Directory.
3642

3743
## EXAMPLES
3844

3945
### Example 1: Remove AD DS from a domain controller
40-
```
41-
PS C:\> Uninstall-ADDSDomainController
46+
47+
```powershell
48+
Uninstall-ADDSDomainController
4249
```
4350

44-
This command removes AD DS from an additional domain controller in a domain.
45-
The user is prompted to set and confirm the local Administrator password prior to completing the removal process.
51+
This command removes AD DS from an additional domain controller in a domain. The user is prompted to
52+
set and confirm the local Administrator password prior to completing the removal process.
4653

4754
## PARAMETERS
4855

4956
### -Confirm
57+
5058
Prompts you for confirmation before running the cmdlet.
5159

5260
```yaml
53-
Type: SwitchParameter
61+
Type: System.Management.Automation.SwitchParameter
5462
Parameter Sets: (All)
5563
Aliases: cf
5664

@@ -62,12 +70,14 @@ Accept wildcard characters: False
6270
```
6371
6472
### -Credential
65-
Specifies the user name and password that corresponds to the account used to install the domain controller.
66-
Use the **Get-Credential** cmdlet to prompt the user to supply a password in place of an existing *PSCredential* type.
67-
This causes Windows PowerShell to prompt the user to enter credentials using the Windows security login UI.
73+
74+
Specifies the user name and password that corresponds to the account used to install the domain
75+
controller. Use the `Get-Credential` cmdlet to prompt the user to supply a password in place of an
76+
existing **System.Management.Automation.PSCredential** type. This causes Windows PowerShell to
77+
prompt the user to enter credentials using the Windows security login UI.
6878

6979
```yaml
70-
Type: PSCredential
80+
Type: System.Management.Automation.PSCredential
7181
Parameter Sets: (All)
7282
Aliases:
7383
@@ -79,10 +89,12 @@ Accept wildcard characters: False
7989
```
8090

8191
### -DemoteOperationMasterRole
82-
Indicates that forced demotion should continue even if an operations master role is discovered on domain controller from which AD DS is being removed.
92+
93+
Indicates that forced demotion should continue even if an operations master role is discovered on
94+
the domain controller from which AD DS is being removed.
8395

8496
```yaml
85-
Type: SwitchParameter
97+
Type: System.Management.Automation.SwitchParameter
8698
Parameter Sets: (All)
8799
Aliases:
88100
@@ -94,12 +106,14 @@ Accept wildcard characters: False
94106
```
95107

96108
### -DnsDelegationRemovalCredential
97-
Specifies the account credentials to use when you create or remove the DNS delegation.
98-
If you do not specify a value, the account credentials that you specify for the AD DS installation or removal are used to remove the DNS delegation.
99-
As an alternative, you can specify the asterisk (*) to prompt the user to enter credentials.
109+
110+
Specifies the account credentials to use when you create or remove the DNS delegation. If you do
111+
not specify a value, the account credentials that you specify for the AD DS installation or removal
112+
are used to remove the DNS delegation. As an alternative, you can specify the asterisk (`*`) to
113+
prompt the user to enter credentials.
100114

101115
```yaml
102-
Type: PSCredential
116+
Type: System.Management.Automation.PSCredential
103117
Parameter Sets: ADDSDomainControllerUninstall
104118
Aliases:
105119
@@ -111,10 +125,11 @@ Accept wildcard characters: False
111125
```
112126

113127
### -Force
128+
114129
Forces the command to run without asking for user confirmation.
115130

116131
```yaml
117-
Type: SwitchParameter
132+
Type: System.Management.Automation.SwitchParameter
118133
Parameter Sets: (All)
119134
Aliases:
120135
@@ -126,11 +141,13 @@ Accept wildcard characters: False
126141
```
127142

128143
### -ForceRemoval
129-
Indicates that the cmdlet forces the removal of a domain controller.
130-
Use this parameter to force the uninstall of AD DS if you need to remove the domain controller and do not have connectivity to other domain controllers within the domain topology.
144+
145+
Indicates that the cmdlet forces the removal of a domain controller. Use this parameter to force the
146+
uninstall of AD DS if you need to remove the domain controller and do not have connectivity to other
147+
domain controllers within the domain topology.
131148

132149
```yaml
133-
Type: SwitchParameter
150+
Type: System.Management.Automation.SwitchParameter
134151
Parameter Sets: ADDSDomainControllerUninstallForceRemoval
135152
Aliases:
136153
@@ -142,12 +159,19 @@ Accept wildcard characters: False
142159
```
143160

144161
### -IgnoreLastDCInDomainMismatch
145-
Indicates that Windows PowerShell ignores any inconsistency that it detects with the value that you specify for the *LastDomainControllerInDomain* parameter.
146-
For instance, if you specify *LastDomainControllerInDomain* but Windows PowerShell detects that there is actually another active domain controller in the domain, you can specify the *IgnoreLastDCInDomainMismatch* parameter to have Windows PowerShell continue the removal of AD DS from the domain controller despite the inconsistency that it has detected.
147-
Similarly, if you do not specify *LastDomainControllerInDomain* but Windows PowerShell cannot detect that another domain controller is in the domain, you can specify *IgnoreLastDCInDomainMismatch* to have Windows PowerShell continue to remove AD DS from the domain controller.
162+
163+
Indicates that Windows PowerShell ignores any inconsistency that it detects with the value that you
164+
specify for the **LastDomainControllerInDomain** parameter. For instance, if you specify
165+
**LastDomainControllerInDomain** but Windows PowerShell detects that there is actually another
166+
active domain controller in the domain, you can specify the **IgnoreLastDCInDomainMismatch**
167+
parameter to have Windows PowerShell continue the removal of AD DS from the domain controller
168+
despite the inconsistency that it has detected. Similarly, if you do not specify
169+
**LastDomainControllerInDomain** but Windows PowerShell cannot detect that another domain
170+
controller is in the domain, you can specify **IgnoreLastDCInDomainMismatch** to have Windows
171+
PowerShell continue to remove AD DS from the domain controller.
148172

149173
```yaml
150-
Type: SwitchParameter
174+
Type: System.Management.Automation.SwitchParameter
151175
Parameter Sets: ADDSDomainControllerUninstall
152176
Aliases:
153177
@@ -159,10 +183,12 @@ Accept wildcard characters: False
159183
```
160184

161185
### -IgnoreLastDnsServerForZone
162-
Indicates that the cmdlet continues the removal of AD DS despite the fact that the domain controller is the last DNS server for one or more of the Active Directory-integrated DNS zones that it hosts.
186+
187+
Indicates that the cmdlet continues the removal of AD DS despite the fact that the domain controller
188+
is the last DNS server for one or more of the Active Directory-integrated DNS zones that it hosts.
163189

164190
```yaml
165-
Type: SwitchParameter
191+
Type: System.Management.Automation.SwitchParameter
166192
Parameter Sets: ADDSDomainControllerUninstall
167193
Aliases:
168194
@@ -174,10 +200,12 @@ Accept wildcard characters: False
174200
```
175201

176202
### -LastDomainControllerInDomain
177-
Indicates that the computer from which AD DS is being removed is the last domain controller in the domain.
203+
204+
Indicates that the computer from which AD DS is being removed is the last domain controller in the
205+
domain.
178206

179207
```yaml
180-
Type: SwitchParameter
208+
Type: System.Management.Automation.SwitchParameter
181209
Parameter Sets: ADDSDomainControllerUninstall
182210
Aliases:
183211
@@ -189,20 +217,24 @@ Accept wildcard characters: False
189217
```
190218

191219
### -LocalAdministratorPassword
192-
Specifies a local administrator account password when AD DS is removed from a domain controller.
193-
In earlier releases, where uninstall of AD DS was done using Dcpromo.exe for demotion, the default was to allow an empty password for this setting.
194-
In Windows PowerShell, the ADDS Deployment module requires that a non-empty password string value be assigned.
195-
If a value is not provided for this parameter, you are prompted to enter a value for the password at the Windows PowerShell prompt.
196-
The password value must be a secure string.
220+
221+
Specifies a local administrator account password when AD DS is removed from a domain controller. In
222+
earlier releases, where uninstall of AD DS was done using `Dcpromo.exe` for demotion, the default
223+
was to allow an empty password for this setting. In Windows PowerShell, the ADDS Deployment module
224+
requires that a non-empty password string value be assigned. If a value is not provided for this
225+
parameter, you are prompted to enter a value for the password at the Windows PowerShell prompt. The
226+
password value must be a secure string.
197227

198228
If this parameter is not specified, the cmdlet prompts you to enter and confirm a masked password.
199-
This is the preferred usage when running the cmdlet interactively.
200-
If additionally there are no other arguments specified with the cmdlet, you are prompted to enter a masked password for this parameter but no confirmation of the password entered is made.
201-
This is not recommended as it could allow a mistyped password to be configured.
202-
Another available advanced option is to use the **ConvertTo-SecureString** cmdlet and specify the password string inline as unmasked console input, which is also not a recommended security best practice in production deployments.
229+
This is the preferred usage when running the cmdlet interactively. If additionally there are no
230+
other arguments specified with the cmdlet, you are prompted to enter a masked password for this
231+
parameter but no confirmation of the password entered is made. This is not recommended as it could
232+
allow a mistyped password to be configured. Another available advanced option is to use the
233+
`ConvertTo-SecureString` cmdlet and specify the password string inline as unmasked console input,
234+
which is also not a recommended security best practice in production deployments.
203235

204236
```yaml
205-
Type: SecureString
237+
Type: System.Security.SecureString
206238
Parameter Sets: (All)
207239
Aliases:
208240
@@ -214,12 +246,15 @@ Accept wildcard characters: False
214246
```
215247

216248
### -NoRebootOnCompletion
217-
Indicates that the cmdlet restarts the computer upon completion, regardless of success.
218-
By default, reboot upon completion occurs when this cmdlet is used and this parameter is omitted.
219-
As a general rule, Microsoft support recommends that you not use this parameter except for testing or troubleshooting purposes because once configuration has completed the server will not function correctly as either a member server or a DC until it is rebooted.
249+
250+
Indicates that the cmdlet restarts the computer upon completion, regardless of success. By default,
251+
reboot upon completion occurs when this cmdlet is used and this parameter is omitted. As a general
252+
rule, Microsoft support recommends that you not use this parameter except for testing or
253+
troubleshooting purposes because once configuration has completed the server will not function
254+
correctly as either a member server or a DC until it is rebooted.
220255

221256
```yaml
222-
Type: SwitchParameter
257+
Type: System.Management.Automation.SwitchParameter
223258
Parameter Sets: (All)
224259
Aliases:
225260
@@ -231,10 +266,12 @@ Accept wildcard characters: False
231266
```
232267

233268
### -RemoveApplicationPartitions
234-
Indicates that this cmdlet removes application partitions during the removal of AD DS from a domain controller.
269+
270+
Indicates that this cmdlet removes application partitions during the removal of AD DS from a domain
271+
controller.
235272

236273
```yaml
237-
Type: SwitchParameter
274+
Type: System.Management.Automation.SwitchParameter
238275
Parameter Sets: ADDSDomainControllerUninstall
239276
Aliases:
240277
@@ -247,11 +284,13 @@ Accept wildcard characters: False
247284

248285
### -RemoveDnsDelegation
249286

250-
Specifies whether to preserve DNS delegation that point to this DNS server from the parent DNS Zone. If you use this parameter, DNS delegations that point to this server from the parent DNS zone will not be retained after uninstallation of the domain controller.
251-
This setting corresponds to the earlier Dcpromo.exe parameter default of /RemoveDNSDelegation:Yes.
287+
Specifies whether to preserve DNS delegation that point to this DNS server from the parent DNS Zone.
288+
If you use this parameter, DNS delegations that point to this server from the parent DNS zone will
289+
not be retained after uninstallation of the domain controller. This setting corresponds to the
290+
earlier `Dcpromo.exe` parameter default of `/RemoveDNSDelegation:Yes`.
252291

253292
```yaml
254-
Type: SwitchParameter
293+
Type: System.Management.Automation.SwitchParameter
255294
Parameter Sets: ADDSDomainControllerUninstall
256295
Aliases:
257296
@@ -263,10 +302,12 @@ Accept wildcard characters: False
263302
```
264303

265304
### -RetainDCMetadata
266-
Indicates that metadata from the domain controller should be preserved after uninstallation is completed.
305+
306+
Indicates that metadata from the domain controller should be preserved after uninstallation is
307+
completed.
267308

268309
```yaml
269-
Type: SwitchParameter
310+
Type: System.Management.Automation.SwitchParameter
270311
Parameter Sets: ADDSDomainControllerUninstall
271312
Aliases:
272313
@@ -278,13 +319,17 @@ Accept wildcard characters: False
278319
```
279320

280321
### -SkipPreChecks
281-
Indicates that only a base set of validations is performed.
282-
This behavior is equivalent to the validations that were performed when using Dcpromo.exe in earlier versions of Windows Server to add a new domain controller.
283-
When this switch parameter is set, it specifies that additional preliminary checks should be bypassed.
284-
For more information on the scope of these additional preliminary checks that the ADDSDeployment module performs by default when using Windows Server 2012, refer to the table in the section ADPrep and Prerequisite Checking Architecture in [AD DS Simplified Administration](https://go.microsoft.com/fwlink/?LinkID=237244).
322+
323+
Indicates that only a base set of validations is performed. This behavior is equivalent to the
324+
validations that were performed when using `Dcpromo.exe` in earlier versions of Windows Server to
325+
add a new domain controller. When this switch parameter is set, it specifies that additional
326+
preliminary checks should be bypassed. For more information on the scope of these additional
327+
preliminary checks that the **ADDSDeployment** module performs by default when using Windows Server
328+
2012, refer to the table in the section ADPrep and Prerequisite Checking Architecture in
329+
[AD DS Simplified Administration](https://go.microsoft.com/fwlink/?LinkID=237244).
285330

286331
```yaml
287-
Type: SwitchParameter
332+
Type: System.Management.Automation.SwitchParameter
288333
Parameter Sets: (All)
289334
Aliases:
290335
@@ -296,11 +341,11 @@ Accept wildcard characters: False
296341
```
297342

298343
### -WhatIf
299-
Shows what would happen if the cmdlet runs.
300-
The cmdlet is not run.
344+
345+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
301346

302347
```yaml
303-
Type: SwitchParameter
348+
Type: System.Management.Automation.SwitchParameter
304349
Parameter Sets: (All)
305350
Aliases: wi
306351
@@ -312,7 +357,11 @@ Accept wildcard characters: False
312357
```
313358

314359
### CommonParameters
315-
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).
360+
361+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
362+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
363+
-WarningAction, and -WarningVariable. For more information, see
364+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
316365

317366
## INPUTS
318367

@@ -329,4 +378,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
329378
[Get-Credential](https://go.microsoft.com/fwlink/?LinkID=293936)
330379

331380
[ConvertTo-SecureString](https://go.microsoft.com/fwlink/p/?LinkId=113291)
332-

0 commit comments

Comments
 (0)