gistfile1.txt
· 522 B · Text
Raw
# Create the user "Hareash S" in the AD_PowerShell OU
New-ADUser -Name "Hareash S" `
-GivenName "Hareash" `
-Surname "S" `
-SamAccountName "HS" `
-UserPrincipalName "Hareash@Xceed.com" `
-AccountPassword (ConvertTo-SecureString "Welcome123$" -AsPlainText -Force) `
-Path "OU=AD_PowerShell,DC=Xceed,DC=com" `
-Enabled $true `
-OtherAttributes @{
title = "Admin";
department = "ITIS";
company = "TCS";
manager = "CN=Hari,OU=AD_PowerShell,DC=Xceed,DC=com"
}
1 | # Create the user "Hareash S" in the AD_PowerShell OU |
2 | New-ADUser -Name "Hareash S" ` |
3 | -GivenName "Hareash" ` |
4 | -Surname "S" ` |
5 | -SamAccountName "HS" ` |
6 | -UserPrincipalName "Hareash@Xceed.com" ` |
7 | -AccountPassword (ConvertTo-SecureString "Welcome123$" -AsPlainText -Force) ` |
8 | -Path "OU=AD_PowerShell,DC=Xceed,DC=com" ` |
9 | -Enabled $true ` |
10 | -OtherAttributes @{ |
11 | title = "Admin"; |
12 | department = "ITIS"; |
13 | company = "TCS"; |
14 | manager = "CN=Hari,OU=AD_PowerShell,DC=Xceed,DC=com" |
15 | } |