<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2522 " id="quads-ad2522" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<p>First of all you will need to connect to your tenant with your global admin account using the following script</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2524 " id="quads-ad2524" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2530 " id="quads-ad2530" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2526 " id="quads-ad2526" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<p>Import-Module MSOnline</p>



<p>$O365Cred = Get-Credential</p>



<p>$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri<a href="https://www.google.com/url?q=https%3A%2F%2Fps.outlook.com%2Fpowershell&;sa=D&;sntz=1&;usg=AFQjCNG6kFRYvmIcjlQdnFK1Kf4g8-0vgg" target="_blank" rel="noreferrer noopener">https://ps.outlook.com/powershell</a> -Credential $O365Cred -Authentication Basic -AllowRedirection</p>



<p>Import-PSSession $O365Session</p>



<p>Connect-MsolService –Credential $O365Cred</p>



<p>After connecting you will need to type the following command line which will export all users in a specific domain that&#8217;s added to your portal if you have more than one domain added there.</p>



<p>Get-MsolUser -DomainName Domain.com | Select UserPrincipalName | Export-Csv C:\users.csv –NoTypeInformation</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2531 " id="quads-ad2531" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<figure class="wp-block-image"><img src="http://lh6.ggpht.com/-Mb2RzsW7GkA/VN3zkjoC0UI/AAAAAAAAMrE/MIQRvSHpJyc/clip_image001_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image001"/> 

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2529 " id="quads-ad2529" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 
</figure>



<p>Change passwords for those users by using the following command and pressing enter you&#8217;ll be giving a line to enter your new password that you wanna set for all users in the exported file.</p>



<p>$PASS = Read-Host</p>



<figure class="wp-block-image"><img src="http://lh3.ggpht.com/-4u7J1rAQ18A/VN3zmf-EBbI/AAAAAAAAMrU/WbDQ8PNUo0Y/clip_image002_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image002"/></figure>



<p>Run this command to change the passwords</p>



<p>Import-Csv C:\Users.csv | % {Set-MsolUserPassword -userPrincipalName $_.UserPrincipalName -NewPassword $PASS -ForceChangePassword $True}</p>



<figure class="wp-block-image"><img src="http://lh6.ggpht.com/-04McFQJ9Nz0/VN3zoPH0YHI/AAAAAAAAMrk/XZc-xCUyw8I/clip_image003_thumb%25255B1%25255D.png?imgmax=800" alt="clip_image003"/></figure>



<p>That&#8217;s it. Now users inside the exported csv file have the new password which you have just set.</p>



<p>Note that users will be prompted to reset their passwords upon login, if you don&#8217;t want this to happen you can remove the -ForceChangePassword $True parameter.</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2525 " id="quads-ad2525" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<p>del.icio.us Tags: <a href="http://www.google.com/url?q=http%3A%2F%2Fdel.icio.us%2Fpopular%2FOffice365&;sa=D&;sntz=1&;usg=AFQjCNGSTlfkH-KDWW6MMgoVtonTkrUcZg" target="_blank" rel="noreferrer noopener">Office365</a>,<a href="http://www.google.com/url?q=http%3A%2F%2Fdel.icio.us%2Fpopular%2FOffice%2B365&;sa=D&;sntz=1&;usg=AFQjCNESMLAbwuAQ0Ic0oEcAZd5bseYYaQ" target="_blank" rel="noreferrer noopener">Office 365</a>,<a href="http://www.google.com/url?q=http%3A%2F%2Fdel.icio.us%2Fpopular%2FExchange%2BOnline&;sa=D&;sntz=1&;usg=AFQjCNGAKLITuQ2LKs3cbIDQ6lHsaXomBA" target="_blank" rel="noreferrer noopener">Exchange Online</a>,<a href="http://www.google.com/url?q=http%3A%2F%2Fdel.icio.us%2Fpopular%2FAzure&;sa=D&;sntz=1&;usg=AFQjCNE_bbK04iwfa1UOx5IWXxHCM4JfgA" target="_blank" rel="noreferrer noopener">Azure</a><br></p>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2523 " id="quads-ad2523" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>


Reset and manage your Active Directory users' Passwords Active Directory is one of the most…
Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…
If you're using a Proxy server in your firewall or in your network and have…
Story:I got some clients that have reported some of their users being locked out and…
Delegate Permissions This is a code that I have wrote recently to check if an…
Story: I got a request from a client who constantly gets CVs and have to…