Skip to main content

Great article on setting Office 365 passwords using powershell.

http://o365info.com/manage-office-365-users-password-using/

Notice the use of $_. to refer to columns in a CSV file 

Set a Predefined Password for Office 365 user

PowerShell command Syntax
Set-MsolUserPassword –UserPrincipalName <UserPrincipalName> –NewPassword <New Password> -ForceChangePassword $False

Set a Predefined Password for Office 365 users imported from a CSV File

Step 1:
Get-MsolUser | Select UserPrincipalName|Export-CSV C:\Temp\o365users.csv

Step 2:
Import-CSV C:\Temp\o365users.csv |%{Set-MsolUserPassword -userPrincipalName $_.UserPrincipalName –NewPassword AbcAs123 -ForceChangePassword $False}

Creating a new user and password from a CSV file
Import-CSV –Path C:\Temp\users.csv| ForEach-Object { New-MsolUser -UserPrincipalName $_.UserPrincipalName -FirstName $_.FirstName -LastName $_.LastName  -DisplayName "$($_.FirstName) $($_.LastName)" –Password $_.Password –UsageLocation “AU” }

Comments

Popular posts from this blog

Javascript Form Validation

It's real simple. All you need to do is call a javascript function in a html  " onsubmit " in the form tag as a javascript return, like this       <form method="post" action="dosomething.php" onsubmit="return validateForm();"> If the code completes ok, the form is then sent to the page listed in "action" http://www.w3schools.com/js/js_form_validation.asp If the function specified in the onsubmit returns false, then the form is not sent to the page mentioned in action.