User Password Expiration Date

Forums Desktop Info User Password Expiration Date

Viewing 11 reply threads
  • Author
    Posts
    • #4984
      zeljko
      Participant

      I need to show the password expiration date. Can this be achieved with Desktopinfo?

    • #4985
      Glenn
      Keymaster

      something like this:

    • #4986
      zeljko
      Participant

      Your solution works fantastic. Great piece of software, by the way. One problem with your solution is with users who have the expiration date set to “Never”, desktopinfo displays <NULL>. Also, it would be nice if i could display the number of days left till expiration.

      • #4997
        Glenn
        Keymaster

        This will return a result only if there is a password expiry date. If the date is null, ie password does not expire, then the “hide-no-result” option will cause the item to not display.

    • #4987
      zeljko
      Participant

      Another problem has arisen. On my comp all works fine, but on the terminal I’m running as a server, no WMI query gets executed. Do I have to configure something to have WMI queries run?

      • #4998
        Glenn
        Keymaster

        probably a permission issue. try running DTI as admin.

    • #4988
      rtruss
      Participant

      I like that as well. Getting consensus now on whether to add it or not.

      Attachments:
    • #4990
      zeljko
      Participant

      It works when switching to version 3. But what is strange, on my comp it lists only my expiry date but on the server, it lists the expiration dates for all users. the same query in powershell:
      Get-WmiObject -query "SELECT * FROM Win32_NetworkLoginProfile where UserType='Normal Account' and Privileges>0'
      returns 1 result on my comp and all user expiration dates on the server.

      • #4999
        Glenn
        Keymaster
    • #5000
      zeljko
      Participant

      Thanks for the quick response. The filtering works fine. But unfortunately the date is not correct (or I am misinterpreting the result – I expect to get the expiration date for AD). For the expiration date, I get 22.02.2022 but the correct expiration date is 11.04.2022. The server is part of a domain. Also the query is pretty slow (1 minute – approximately 3500 users).
      I get the correct date when running in the commandline:

      net user <USERNAME> / DOMAIN

      The result gives me multiple lines for output. One is “Password expires” with the correct date and the query is instantenous. Could it somehow be possible to use this command prompt query to get the result?

    • #5001
      Glenn
      Keymaster

      I can’t account for the date, possibly different between the local machine and the domain server. You can use the CMD item but it returns a big chunk of unfilterable text. You can also research that query using powershell but that’s above my pay grade.

    • #5002
      rtruss
      Participant

      I found that you can run this net user ‘username’ /domain | find “Password expires” It IS case sensitive sadly but I was able to get the expiration date that way. Now if only I could figure out how to do this with my Azure AD users using modern workplace Azure ad joined devices.

      • This reply was modified 1 week, 5 days ago by rtruss.
      Attachments:
    • #5005
      rtruss
      Participant

      So I have a mixed environment and only want to show password expiry to my hybrid computers as the azure only units simply will not work.
      Here is what I have tried thus far to no avail 🙁

      DOMAIN=hide-no-result:1
      If=value1:%DOMAIN%, value2:domain.name comp:eq
      WMI=namespace:root\cimv2,query:Win32_NetworkLoginProfile where UserType=”Normal Account” and Privileges>0,color:%Green%,text:Password Expires on:,display:%PasswordExpires_month%[2.0d]/%PasswordExpires_day%[2.0d]/%PasswordExpires_year%

      Am I missing something as the above code will not allow the expire date to display.

      Thanks in advance all.

    • #5007
      Glenn
      Keymaster

      what does it display?

    • #5010
      zeljko
      Participant

      Solved it eventually like this:

      CMD=file:cmd.exe,parameters:/c net USER %username% /DOMAIN | find "Password expires" ,text:,wide:1,color:#FF6347

      The only pitfall is that I don’t know how to replace the “Password expires” text in the resulting output.

Viewing 11 reply threads
  • You must be logged in to reply to this topic.
Glenn's Page