Microsoft Office 365: Change Password From Condition
##Install Module for Manage Resource in AzureAD##
Install-Module -Name AzureAD -Force
##User Credential##
$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential
Connect-MsolService
##Get All Users in Domain##
##Show UserPrincipalName, DisplayName, WhenCreated##
##WhenCreated = 6/24/2018##
##Force Change Password##
Get-Msoluser -All | Select-Object UserPrincipalName, DisplayName, WhenCreated | FT -AutoSize
Get-Msoluser -All | Where-Object WhenCreated -ge 6/24/2018 | Set-MsolUserPassword -NewPassword 'Contoso$@!678' -ForceChangePassword:$TRUE
ไม่มีความคิดเห็น:
แสดงความคิดเห็น