We may need to get a list of the user with older passwords than we expecting. Use below script to get a report about the password age.

##Test if you are logged in.
function MSOLConnected {
Get-MsolDomain -ErrorAction SilentlyContinue | out-null
$result = $?
return $result
}

 

Import-Module MSOnline

if (-not (MSOLConnected)) {
Connect-MSOLService
}

 

 

$Students_BYOD = Get-ADUser -Filter * -SearchBase “OU=2026,OU=Students,OU=Users,DC=curric,DC=your_company,DC=com”
$time_limit=(get-date).Date.AddDays(-68)
foreach($student_BYOD in $Students_BYOD){

Get-MsolUser -UserPrincipalName $student_BYOD.userPrincipalName | select userprincipalname,LastPasswordChangeTimestamp,@{Name=”PasswordAge”;Expression={(Get-Date)-$_.LastPasswordChangeTimeStamp}} | Where-Object { $_.LastPasswordChangeTimeStamp -lt $time_limit} | Export-CSV D:\tmp\LastPasswordChange.csv -NoTypeInformation -Append

}