Comment créer un compte utilisateur Active Directory avec PowerShell
Comment créer un compte utilisateur Active Directory avec PowerShell
Je suis constantly setting up research et development environments that require active directory accounts. Since we place these environments in isloated networks chaque environment needs its own active directory. How can I créez un nouveau active directory account using powershell.
Re: Comment créer un compte utilisateur Active Directory avec PowerShell
Je suis pas sure si you are looking for a script that will take a list of names, passwords, etc, mais le suivant command works to create one nouveau user. UserPrincipalName is optional. In this case, email is pas used.
```
New-ADUser -SamAccountName nnn2 -Name "nnn2" -UserPrincipalName nnn2@jj -AccountPassword (ConvertTo-SecureString -AsPlainText "somePassword" -Force) -Enabled $true -PasswordNeverExpires $true -Path 'CN=Users,DC=jjdomain,DC=net'
```
If you wish to créez un user in a trusted domain, add **-server dns.domain** to ci-dessus command
```
New-ADUser -SamAccountName nnn2 -Name "nnn2" -UserPrincipalName nnn2@jj -AccountPassword (ConvertTo-SecureString -AsPlainText "somePassword" -Force) -Enabled $true -PasswordNeverExpires $true -Path 'CN=Users,DC=jjdomain,DC=net'
```
If you wish to créez un user in a trusted domain, add **-server dns.domain** to ci-dessus command