No Data Returned

Post Reply
SamOrlando
Posts: 23
Joined: Wed May 01, 2019 2:55 pm
4

No Data Returned

Post by SamOrlando »

Setting up another client and having another issue previous resolutions have not resolved.

On this one, I can manually run the Get-ADUser portion of the script and it runs into no errors, but returns no data.

Code: Select all

PS C:\Users\umsadmin59> Import-Module ActiveDirectory
PS C:\Users\umsadmin59> Get-ADUser -SearchBase "OU=BEC Users,DC=brilleyecenter,DC=local" -properties mail, useraccountco
ntrol, CannotChangePassword, passwordlastset, passwordneverexpires -filter * | select *, `
>>           @{label="passwordage";expression={(new-timespan -end  (Get-Date) -start $_.PasswordlastSet).Days}}, `
>>           @{label="daysleft";expression={($MaxPasswordAgeDays - ((new-timespan -end  (Get-Date) -start $_.Passwordlas
tSet).Days)) }} `
>>         | where {($_.CannotChangePassword -ne $True) `
>>             -and ($_.passwordneverexpires -ne $True) `
>>             -and ($_.UserAccountControl -ne 514) `
>>             -and ($_.mail -ne $null) `
>>             }
PS C:\Users\umsadmin59>
PS C:\Users\umsadmin59>
I check to make sure the ActiveDirectory module is loading; but if it didn't I should have gotten a 'Get-ADUser not recognized' error.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: No Data Returned

Post by Cubert »

Either the OU being sent has no users meeting the criteria or is invalid.

Does that OU have users that have emails that have passwords set to expire?

If a user is seen with the following it is skipped

>> | where {($_.CannotChangePassword -ne $True) `
>> -and ($_.passwordneverexpires -ne $True) `
>> -and ($_.UserAccountControl -ne 514) `
>> -and ($_.mail -ne $null)

Post Reply

Return to “Expiry Domain Password Expiration Plugin”