Skip to content

Instantly share code, notes, and snippets.

View jrgilman's full-sized avatar

Jacob Ray Gilman jrgilman

  • Oscillas Technologies, Inc.
  • Wilmette, IL
View GitHub Profile
@jrgilman
jrgilman / ResetAllPasswords.ps1
Created January 6, 2021 22:56
Resets all user passwords (except the user you are logged in as) in Office 365 via PowerShell and outputs them to a csv
Import-Module MSOnline
Add-Type -AssemblyName 'System.Web'
$creds = Get-Credential
Connect-MsolService -Credential $creds
$ignoreUser = Get-MsolUser -UserPrincipalName $creds.Username
if ($ignoreUser -eq $null) {
Write-Host "Could not find the user you logged in as!"