Quantcast
Channel: Upgrade to Office 365 - Recent Threads
Viewing all articles
Browse latest Browse all 2607

Re: Creating many user accounts

$
0
0
Hi Marcin_S,
 
Normally, the Set-MsolUserPassword cmdlet is used to change the password of one user each time, for instance, Set-MsolUserPassword -userPrincipalName user@contoso.onmicrosoft.com -NewPassword "pa$$word".
 
But if we would like to use this command to change the passwords of all the users in a csv file, we may have to select scripts. Here’s a simple script which may help you:
 
#Import MSOL Module
 
Import-Module MSOnline
 
#enter admin credential to connect to powershell
 
$UserName = 'user@contoso.onmicrosoft.com'
$Password = ConvertTo-SecureString 'xxxx' -AsPlainText -Force
$LiveCred = New-Object System.Management.Automation.PSCredential $Username, $Password
Connect-MsolService -Credential $LiveCred
 
#Batch start from here
 
$Userpassword = Import-csv "c:\test.csv"
Foreach($S in $Userpassword)
{
$setpassword = set-msoluserpassword -userprincipalname $s.username -newpassword $S.password
}
 
Additionally, we understand all the inconveniences you have encountered after the migration. As having mentioned before, we’ll collect all your valuable opinions, and try improving our products based on them.
 
Thanks,
Ella

Viewing all articles
Browse latest Browse all 2607

Trending Articles