Воспользуйтесь powershell, ощутимо проще будет:
Код:

$date=(Get-Date).AddDays(-45)
Get-ADUser -SearchBase "OU=Users,DC=domain,DC=local" -f {(enabled -eq $true) -and (pwdlastset -lt $date)} -properties *| select givenname, surname, initials, department, mobile, passwordlastset