Update AutoUserCreator.ps1

This commit is contained in:
Ray 2024-03-25 22:18:02 +11:00 committed by GitHub
parent a77162135c
commit d52fb7f4e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

View File

@ -9,9 +9,6 @@ Import-Module ActiveDirectory
# Define temporary password which MUST be changed when the user first logs into the Active Directory.
$SecurePass = ConvertTo-SecureString -AsPlainText "Mypassword1" -Force
# Force user to change password when logging on for the first time
ChangePasswordAtLogon = $true
# Define the file path where the CSV file containing users is.
$csvfilepath = Read-Host - Prompt "Please enter the location of the CSV file containing the user list"
@ -20,7 +17,7 @@ ForEach ($user in $users) {
$fname = $user.'First Name
$lname = $user.'Last Name'
$jtitle = $user.'Job Title'
$OUpath = $user.'Organizational Unit'
$OUpath = $user.'Organizational Unit' #Example entry: OU=Staff,OU=Manager,DC=alphadelta,DC=com
# Command to add user's to Active Directory.
New-ADUser -Name $fname -UserPrincipalName "$fname.$lname"