File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
docset/winserver2022-ps/activedirectory Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Creates an Active Directory user.
1616
1717## SYNTAX
1818
19- ```
19+ ``` powershell
2020New-ADUser [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
2121 [-AccountPassword <SecureString>] [-AllowReversiblePasswordEncryption <Boolean>]
2222 [-AuthenticationPolicy <ADAuthenticationPolicy>] [-AuthenticationPolicySilo <ADAuthenticationPolicySilo>]
@@ -78,15 +78,15 @@ through the pipeline to the `New-ADUser` cmdlet to create the user objects.
7878
7979### Example 1: Create a user with an imported certificate
8080
81- ```
81+ ``` powershell
8282PS C:\> New-ADUser -Name "ChewDavid" -Certificate (New-Object System.Security.Cryptography.X509Certificates.X509Certificate -ArgumentList "Export.cer")
8383```
8484
8585This command creates a user named ChewDavid with a certificate imported from the file Export.cer.
8686
8787### Example 2: Create a user and set properties
8888
89- ```
89+ ``` powershell
9090PS C:\> New-ADUser -Name "ChewDavid" -OtherAttributes @{'title'="director";'mail'="[email protected] "} 9191```
9292
@@ -95,15 +95,15 @@ the new object.
9595
9696### Example 3: Create an inetOrgPerson user
9797
98- ```
98+ ``` powershell
9999PS C:\> New-ADUser -Name "ChewDavid" -Type iNetOrgPerson -Path "DC=AppNC" -Server lds.Fabrikam.com:50000
100100```
101101
102102This command creates an ** inetOrgPerson** -class user named ChewDavid on an AD LDS instance.
103103
104104### Example 4: Create a user and set password
105105
106- ```
106+ ``` powershell
107107PS C:\> New-ADUser -Name "ChewDavid" -Accountpassword (Read-Host -AsSecureString "AccountPassword") -Enabled $true
108108```
109109
You can’t perform that action at this time.
0 commit comments