I found this script and i modified it
Import-CSV E:\Users\ntaccount.csv | ForEach {
$user = @{
name=$_.name;
displayname=$_.displayname;
Path=$_.Path
givenname=$_.givenname;
surname=$_.surname;
SAMAccountName=$_.SAMAccountName;
LogonName=$_.LogonName;
Street=$_.street;
City=$_.city;
PostalCode=$_.postalcode;
Country=$_.Country;
Description=$_.description;
emailaddress=$_.emailaddress;
accountpassword=(ConvertTo-SecureString "Temp@1234" -AsPlainText -Force);
};
New-ADUser @user -Enabled $True
Enable-Mailbox $user.samaccountname
}
When i run this script it gives me errors
Error 1
It's not accepting the LOGONNAME. Under account tab in AD. user logon name should be by samaccountname (Sidrao@acbnet.com)
Error 2
It;s not accepting the Enable-mailbox command
Please advise