# Define the password for the accounts
$password = ConvertTo-SecureString -AsPlainText "Password11" -Force
# Create 100 user accounts (user001 to user100)
1..100 | ForEach-Object {
$username = "computer{0:D3}" -f $_
#$username = "user{0:D3}" -f $_
#New-ADUser -Name $username -SamAccountName $username -UserPrincipalName "$username@enron.com.au" -AccountPassword $password -Enabled $true -Path "CN=Users,DC=enron,DC=com,DC=au" -PassThru
New-ADComputer -Name $username -SamAccountName $username -UserPrincipalName "$username@enron.com.au" -AccountPassword $password -Enabled $true -Path "CN=Computers,DC=energy,DC=com,DC=au" -PassThru
}
DavesTechnology: Having worked in IT for many years I work with lots of customers and different technologies. Day to day it should be easy but there is always strange stuff that happens with both. Not often it just works. Let me tell you why... Dave's Technology DavesTechnology
No comments:
Post a Comment