question

rmartin0000 avatar image
1 Vote"
rmartin0000 asked GFl-9821 edited

Adding custom field in BGInfo to display ADaccount password expiry

Hi,
To add custom field to display account password expiry below options tried but non works, kindly advice any feasible solution or powershell query to include in the BGinfo to run and show the pw expiry date.

Option1.
WMI Class....Win32_userAccount
Class_Property.....PasswordExpires
WMI_Query : Select_PasswordCheangable FROM Win32_UserAccount

Result : shows True / False but no date

Option2:
Powershell command to run
Get-ADUser -identity <username> -Filter -Properties | Select Name,AccountExpirationDate

Result : multiple error

Thank you

windows-sysinternals-bginfo
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JasonHall-AU avatar image
0 Votes"
JasonHall-AU answered

This would be interesting to see working.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GFl-9821 avatar image
0 Votes"
GFl-9821 answered GFl-9821 edited

the powershell command doesn't have a correct syntax
this will work in powershell:

 Get-ADUser -identity <username> -Properties * | Select Name,AccountExpirationDate

another property to look for is "msDS-UserPasswordExpiryTimeComputed" (in the select part)

but in order to work the powershell module "ActiveDirectory" has to be installed on the Server/Client


a command that should work would be:
net user <username> /domain | find "Password expires"
(this is specific to the OS language - the "find" filter needs to be tested)





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.