Quantcast
Channel: Technology Ireland » Powershell Commands
Viewing all articles
Browse latest Browse all 5

Script to set all PW to never expire in O365

0
0

Following on from the previous post, here is the complete script. Copy and paste it into Powershell.

It will ask for Id and PW twice, please input.

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Connect-Msolservice

Get-MsolUser | Set-MsolUser -PasswordNeverExpires $true

Get-MsolUser | Select UserPrincipalName, PasswordNeverExpires



Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images