WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Quick Tip - How to check password expiry for a specific vSphere SSO user?

Quick Tip - How to check password expiry for a specific vSphere SSO user?

06.04.2021 by William Lam // 3 Comments

The default password expiry for vSphere Single-Sign On (SSO) users within the vCenter Server Appliance (VCSA) is 90 days and this of course be changed to match your organizations policy. Although the vSphere UI can remind you right before your password expires, you may want to manually check or proactively inventory this information periodically.

To do so, you will need to SSH to the VCSA and use the dir-cli command with --level 2 option to get additional details for a given vSphere SSO user as shown in the example below:

/usr/lib/vmware-vmafd/bin/dir-cli user find-by-name --account william --level 2
Account: william
UPN: william[a]VSPHERE.LOCAL
Account disabled: FALSE
Account locked: FALSE
Password never expires: FALSE
Password expired: FALSE
Password expiry: 8916 day(s) 2 hour(s) 39 minute(s) 30 second(s)

In this particular environment, I have the vSphere SSO password expiry configured to 9000 days and as we can see for this user, there is ~8916 days left before the password expires.

For those looking to automate this, it looks like this is currently only possible using dir-cli but I have submitted a feature request to the recently released PowerCLI vSphere SSO Module to see if this information can also be included in the Get-SsoPersonUser cmdlet. If you need to retrieve the current configured vSphere SSO password expiry, you can use ldapsearch command within the VCSA or the Get-SsoPasswordPolicy cmdlet.

More from my site

  • vCenter Server 6.0 Tidbits Part 9: Creating & managing SSO users using dir-cli
  • PowerCLI Module for managing vCenter Single Sign-On (SSO)
  • Using PowerCLI to automate the retrieval of VCSA Password Policies
  • Enhanced vCenter Server Audit Event & Logging in vSphere 6.7 Update 2
  • Changing "Password will expire in X days" notification for Active Directory users in vSphere Web/H5 Client

Categories // Automation, vSphere Tags // dir-cli, sso

Comments

  1. *protectedSravan Gannarapu says

    04/07/2022 at 8:06 am

    this article helped me to check the sso user password expiry status, is there any possibility to view the current password for the sso user.

    Reply
  2. *protectedPraveen Rao says

    03/28/2024 at 2:25 am

    Hi Liam,
    I would need a command to fetch the Local accounts with below details.

    last login, last password change and password expiration date data at VCSA level.

    Reply
  3. *protectedMarkus Poschmann says

    03/31/2025 at 1:29 am

    Hi,
    Thank you very much for the article.
    It was a while ago. Has anything changed in the meantime regarding integration into the API?
    It would be very helpful if this value could also be accessed via the REST API.

    Best regards
    Markus

    Reply

Leave a Reply to Sravan GannarapuCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025