Skip to content

Commit 9c0b4eb

Browse files
authored
Merge branch 'main' into Update_SmbClientAccessToServer
2 parents 96b1b13 + 60c1c52 commit 9c0b4eb

File tree

2 files changed

+201
-142
lines changed

2 files changed

+201
-142
lines changed

docset/winserver2025-ps/activedirectory/Set-ADDomainMode.md

+99-72
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell.
33
external help file: Microsoft.ActiveDirectory.Management.dll-Help.xml
44
Module Name: ActiveDirectory
5-
ms.date: 12/27/2016
5+
ms.date: 04/11/2024
66
online version: https://learn.microsoft.com/powershell/module/activedirectory/set-addomainmode?view=windowsserver2025-ps&wt.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Set-ADDomainMode
@@ -17,33 +17,39 @@ Sets the domain mode for an Active Directory domain.
1717

1818
```
1919
Set-ADDomainMode [-WhatIf] [-Confirm] [-AuthType <ADAuthType>] [-Credential <PSCredential>]
20-
[-DomainMode] <ADDomainMode> [-Identity] <ADDomain> [-PassThru] [-Server <String>] [<CommonParameters>]
20+
[-DomainMode] <ADDomainMode> [-Identity] <ADDomain> [-PassThru] [-Server <String>]
21+
[<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
24-
The **Set-ADDomainMode** cmdlet sets the domain mode for a domain.
25-
You specify the domain mode by setting the *DomainMode* parameter.
2625

27-
The *Identity* parameter specifies the Active Directory domain to modify.
28-
You can identify a domain by its distinguished name, GUID, security identifier (SID), DNS domain name, or NetBIOS name.
29-
You can also set the *Identity* parameter to a domain object variable such as `$<localADDomainObject>`, or you can pass a domain object through the pipeline to the *Identity* parameter.
30-
For example, you can use the Get-ADDomain cmdlet to retrieve a domain object and then pass the object through the pipeline operator to the **Set-ADDomainMode** cmdlet.
26+
The `Set-ADDomainMode` cmdlet sets the domain mode for a domain. You specify the domain mode by
27+
setting the **DomainMode** parameter.
3128

32-
The **Set-ADDomainMode** cmdlet always prompts for permission unless you specify *Confirm:$False*.
29+
The **Identity** parameter specifies the Active Directory domain to modify. You can identify a
30+
domain by its distinguished name, GUID, security identifier (SID), DNS domain name, or NetBIOS
31+
name. You can also set the **Identity** parameter to a domain object variable such as
32+
`$<localADDomainObject>`, or you can pass a domain object through the pipeline to the **Identity**
33+
parameter. For example, you can use the `Get-ADDomain` cmdlet to retrieve a domain object and then
34+
pass the object through the pipeline operator to the `Set-ADDomainMode` cmdlet.
35+
36+
The `Set-ADDomainMode` cmdlet always prompts for permission unless you specify **Confirm:$False**.
3337

3438
## EXAMPLES
3539

3640
### Example 1: Set the domain mode of a specified user to Windows2003Domain
37-
```
38-
PS C:\> Set-ADDomainMode -Identity user01.com -DomainMode Windows2003Domain
41+
42+
```powershell
43+
Set-ADDomainMode -Identity user01.com -DomainMode Windows2003Domain
3944
```
4045

41-
This command sets the **DomainMode** property of the user01.com domain to Windows2003Domain.
46+
This command sets the **DomainMode** property of the `user01.com` domain to `Windows2003Domain`.
4247

4348
### Example 2: Set the domain mode of the current user's domain to Windows2003Domain
44-
```
45-
PS C:\> $PDC = Get-ADDomainController -Discover -Service PrimaryDC
46-
PS C:\> Set-ADDomainMode -Identity $PDC.Domain -Server $PDC.HostName[0] -DomainMode Windows2003Domain
49+
50+
```powershell
51+
$PDC = Get-ADDomainController -Discover -Service PrimaryDC
52+
Set-ADDomainMode -Identity $PDC.Domain -Server $PDC.HostName[0] -DomainMode Windows2003Domain
4753
```
4854

4955
This example sets the **DomainMode** of the current logged on user's domain to Windows2003Domain.
@@ -52,8 +58,8 @@ The set operation targets the PrimaryDC FSMO to apply the update.
5258
## PARAMETERS
5359

5460
### -AuthType
55-
Specifies the authentication method to use.
56-
The acceptable values for this parameter are:
61+
62+
Specifies the authentication method to use. The acceptable values for this parameter are:
5763

5864
- Negotiate or 0
5965
- Basic or 1
@@ -75,33 +81,22 @@ Accept pipeline input: False
7581
Accept wildcard characters: False
7682
```
7783
78-
### -Confirm
79-
Prompts you for confirmation before running the cmdlet.
80-
81-
```yaml
82-
Type: SwitchParameter
83-
Parameter Sets: (All)
84-
Aliases: cf
85-
86-
Required: False
87-
Position: Named
88-
Default value: False
89-
Accept pipeline input: False
90-
Accept wildcard characters: False
91-
```
92-
9384
### -Credential
94-
Specifies the user account credentials to use to perform this task.
95-
The default credentials are the credentials of the currently logged on user unless the cmdlet is run from an Active Directory module for Windows PowerShell provider drive.
96-
If the cmdlet is run from such a provider drive, the account associated with the drive is the default.
9785
98-
To specify this parameter, you can type a user name, such as User1 or Domain01\User01 or you can specify a **PSCredential** object.
99-
If you specify a user name for this parameter, the cmdlet prompts for a password.
86+
Specifies the user account credentials to use to perform this task. The default credentials are the
87+
credentials of the currently logged on user unless the cmdlet is run from an Active Directory
88+
module for Windows PowerShell provider drive. If the cmdlet is run from such a provider drive, the
89+
account associated with the drive is the default.
90+
91+
To specify this parameter, you can type a user name, such as `User1` or `Domain01\User01` or you can
92+
specify a **PSCredential** object. If you specify a user name for this parameter, the cmdlet
93+
prompts for a password.
10094

101-
You can also create a **PSCredential** object by using a script or by using the **Get-Credential** cmdlet.
102-
You can then set the *Credential* parameter to the **PSCredential** object.
95+
You can also create a **PSCredential** object by using a script or by using the `Get-Credential`
96+
cmdlet. You can then set the **Credential** parameter to the **PSCredential** object.
10397

104-
If the acting credentials do not have directory-level permission to perform the task, Active Directory module for Windows PowerShell returns a terminating error.
98+
If the acting credentials do not have directory-level permission to perform the task, Active
99+
Directory module for Windows PowerShell returns a terminating error.
105100

106101
```yaml
107102
Type: PSCredential
@@ -116,9 +111,11 @@ Accept wildcard characters: False
116111
```
117112

118113
### -DomainMode
114+
119115
Specifies the domain functional level of the first domain in the creation of a new forest.
120-
Supported values for this parameter can be either a valid integer or a corresponding enumerated string value.
121-
For example, to set the domain mode level to Windows Server 2008 R2, you can specify either a value of **4** or **Windows2008R2Domain**.
116+
Supported values for this parameter can be either a valid integer or a corresponding enumerated
117+
string value. For example, to set the domain mode level to Windows Server 2008 R2, you can specify
118+
either a value of **4** or **Windows2008R2Domain**.
122119

123120
The following are the currently supported values:
124121

@@ -130,16 +127,18 @@ The following are the currently supported values:
130127
- Windows Server 2012: **5** or **Windows2012Domain**
131128
- Windows Server 2012 R2: **6** or **Windows2012R2Domain**
132129
- Windows Server 2016: **7** or **WinThreshold**
130+
- Windows Server 2025: **10** or **Windows2025Domain**
133131

134132
The domain functional level cannot be lower than the forest functional level, but it can be higher.
135-
The functional level can be increased, and also decreased as long as no feature that requires that functional level is in use, such as the Active Directory Recycle Bin.
136-
The default is automatically computed and set.
133+
The functional level can be increased, and also decreased as long as no feature that requires that
134+
functional level is in use, such as the Active Directory Recycle Bin. The default is automatically
135+
computed and set.
137136

138137
```yaml
139138
Type: ADDomainMode
140139
Parameter Sets: (All)
141140
Aliases:
142-
Accepted values: Windows2000Domain, Windows2003InterimDomain, Windows2003Domain, Windows2008Domain, Windows2008R2Domain, Windows2012Domain, Windows2012R2Domain, Windows2016Domain, UnknownDomain
141+
Accepted values: Windows2000Domain, Windows2003InterimDomain, Windows2003Domain, Windows2008Domain, Windows2008R2Domain, Windows2012Domain, Windows2012R2Domain, Windows2016Domain, Windows2025Domain, UnknownDomain
143142
144143
Required: True
145144
Position: 2
@@ -149,21 +148,23 @@ Accept wildcard characters: False
149148
```
150149

151150
### -Identity
152-
Specifies an Active Directory domain object by providing one of the following property values.
153-
The identifier in parentheses is the Lightweight Directory Access Protocol (LDAP) display name for the attribute.
154-
All values are for the domainDNS object that represents the domain.
155-
The acceptable values for this parameter are:
151+
152+
Specifies an Active Directory domain object by providing one of the following property values. The
153+
identifier in parentheses is the Lightweight Directory Access Protocol (LDAP) display name for the
154+
attribute. All values are for the domainDNS object that represents the domain. The acceptable
155+
values for this parameter are:
156156

157157
- A distinguished name
158158
- A GUID (objectGUID)
159159
- A security identifier (objectSid)
160-
- A DNS domain name
160+
- A DNS domain name
161161
- A NetBIOS domain name
162162

163163
The cmdlet searches the default naming context or partition to find the object.
164164
If two or more objects are found, the cmdlet returns a non-terminating error.
165165

166-
This parameter can also get this object through the pipeline or you can set this parameter to a domain object instance.
166+
This parameter can also get this object through the pipeline or you can set this parameter to a
167+
domain object instance.
167168

168169
```yaml
169170
Type: ADDomain
@@ -178,8 +179,9 @@ Accept wildcard characters: False
178179
```
179180

180181
### -PassThru
181-
Returns an object representing the item with which you are working.
182-
By default, this cmdlet does not generate any output.
182+
183+
Returns an object representing the item with which you are working. By default, this cmdlet does
184+
not generate any output.
183185

184186
```yaml
185187
Type: SwitchParameter
@@ -194,8 +196,11 @@ Accept wildcard characters: False
194196
```
195197

196198
### -Server
197-
Specifies the Active Directory Domain Services instance to connect to, by providing one of the following values for a corresponding domain name or directory server.
198-
The service may be any of the following: Active Directory Lightweight Domain Services, Active Directory Domain Services or Active Directory snapshot instance.
199+
200+
Specifies the Active Directory Domain Services instance to connect to, by providing one of the
201+
following values for a corresponding domain name or directory server. The service may be any of the
202+
following: Active Directory Lightweight Domain Services, Active Directory Domain Services or Active
203+
Directory snapshot instance.
199204

200205
Specify the Active Directory Domain Services instance in one of the following ways:
201206

@@ -210,10 +215,12 @@ Directory server values:
210215
- NetBIOS name
211216
- Fully qualified directory server name and port
212217

213-
The default value for this parameter is determined by one of the following methods in the order that they are listed:
218+
The default value for this parameter is determined by one of the following methods in the order
219+
that they are listed:
214220

215-
- By using the *Server* value from objects passed through the pipeline
216-
- By using the server information associated with the Active Directory Domain Services Windows PowerShell provider drive, when the cmdlet runs in that drive
221+
- By using the **Server** value from objects passed through the pipeline
222+
- By using the server information associated with the Active Directory Domain Services Windows
223+
PowerShell provider drive, when the cmdlet runs in that drive
217224
- By using the domain of the computer running Windows PowerShell
218225

219226
```yaml
@@ -228,9 +235,25 @@ Accept pipeline input: False
228235
Accept wildcard characters: False
229236
```
230237

238+
### -Confirm
239+
240+
Prompts you for confirmation before running the cmdlet.
241+
242+
```yaml
243+
Type: SwitchParameter
244+
Parameter Sets: (All)
245+
Aliases: cf
246+
247+
Required: False
248+
Position: Named
249+
Default value: False
250+
Accept pipeline input: False
251+
Accept wildcard characters: False
252+
```
253+
231254
### -WhatIf
232-
Shows what would happen if the cmdlet runs.
233-
The cmdlet is not run.
255+
256+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
234257

235258
```yaml
236259
Type: SwitchParameter
@@ -245,28 +268,32 @@ Accept wildcard characters: False
245268
```
246269

247270
### CommonParameters
248-
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).
271+
272+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
273+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
274+
-WarningAction, and -WarningVariable. For more information, see
275+
[about_CommonParameters](/powershell/module/microsoft.powershell.core/about/about_commonparameters).
249276

250277
## INPUTS
251278

252279
### Microsoft.ActiveDirectory.Management.ADDomain
253-
A domain object is received by the *Identity* parameter.
280+
281+
A domain object is received by the **Identity** parameter.
254282

255283
## OUTPUTS
256284

257285
### None or Microsoft.ActiveDirectory.Management.ADDomain
258-
This cmdlet returns the modified domain object when the *PassThru* parameter is specified.
259-
By default, this cmdlet does not generate any output.
260286

261-
## NOTES
262-
* This cmdlet does not work with Active Directory Lightweight Directory Services (AD LDS).
263-
* This cmdlet does not work with an Active Directory snapshot.
264-
* This cmdlet does not work with a read-only domain controller.
265-
* This cmdlet does not work when connected to Global Catalog port.
287+
This cmdlet returns the modified domain object when the **PassThru** parameter is specified. By
288+
default, this cmdlet does not generate any output.
266289

267-
## RELATED LINKS
290+
## NOTES
268291

269-
[Get-ADDomain](./Get-ADDomain.md)
292+
- This cmdlet does not work with Active Directory Lightweight Directory Services (AD LDS).
293+
- This cmdlet does not work with an Active Directory snapshot.
294+
- This cmdlet does not work with a read-only domain controller.
295+
- This cmdlet does not work when connected to Global Catalog port.
270296

271-
[AD DS Administration Cmdlets in Windows PowerShell](./activedirectory.md)
297+
## RELATED LINKS
272298

299+
[Get-ADDomain](Get-ADDomain.md)

0 commit comments

Comments
 (0)