This video shows how to create bulk user accounts in Active Directory using PoswerShell.
Here is the script.
**************************************************
# Import the Active Directory module
Import-Module ActiveDirectory
# Path to the CSV file
$csvPath = "C:\users.csv"
# Read the CSV file
$users = Import-Csv $csvPath
# Loop through each user and create the account
foreach ($user in $users) {
$username = $user.Username
$password = $user.Password
$firstname = $user.FirstName
$lastname = $user.LastName
# Create the user account
New-ADUser -SamAccountName $username -UserPrincipalName "$username@jollybuoy.com" -GivenName $firstname -Surname $lastname -Name "$firstname $lastname" -Enabled $true -AccountPassword (ConvertTo-SecureString -AsPlainText $password -Force) -PassThru
}
**********************************************************************
Ещё видео!