Hi
Im hoping someone can help me with a batch file, I need a script to read a simple csv file that contains email addresses
emailaddress
bob@company.com
john@company.com
mary@company.com
etc…
then i need for every email address thats read for the script to output to a txt file the below with the “NewPassword101” number incremented by +1 every output
Set-MsolUser -UserPrincipalName bob@company.com -StrongPasswordRequired $false
Set-MsolUserPassword bob@company.com -NewPassword “NewPassword101”
Set-MsolUser -UserPrincipalName bob@company.com -PasswordNeverExpires $true
so the out put file should look like the below?
txt file————————————
Set-MsolUser -UserPrincipalName bob@company.com -StrongPasswordRequired $false
Set-MsolUserPassword bob@company.com -NewPassword “NewPassword101”
Set-MsolUser -UserPrincipalName bob@company.com -PasswordNeverExpires $true
Set-MsolUser -UserPrincipalName john@company.com -StrongPasswordRequired $false
Set-MsolUserPassword john@company.com -NewPassword “NewPassword102”
Set-MsolUser -UserPrincipalName john@company.com -PasswordNeverExpires $true
Set-MsolUser -UserPrincipalName mary@company.com -StrongPasswordRequired $false
Set-MsolUserPassword mary@company.com -NewPassword “NewPassword103”
Set-MsolUser -UserPrincipalName mary@company.com -PasswordNeverExpires $true
end of txt file——————————————————-
Can anyone help me with this ive tried but im no coder 🙂
1 Answer