Skip to content

Commit

Permalink
Create passwordsNeverExpire.ps1
Browse files Browse the repository at this point in the history
setsl users listed in text file to have passwords never expire in Office365 Exchange
  • Loading branch information
De1337NY authored Oct 1, 2020
1 parent 18e6e0e commit 1803479
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Office365/passwordsNeverExpire.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#reads file C:\scripts\emails.txt and will set all users listed in said file to have passwords never expire in Office365 Exchange

$credential = Get-Credential

Connect-MsolService -Credential $credential

ForEach ($u in [System.IO.File]::ReadLines("C:\Scripts\emails.txt"))
{
Set-MsolUser -UserPrincipalName $u -PasswordNeverExpires $true
}

0 comments on commit 1803479

Please sign in to comment.