Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:03:01+00:00 2026-06-17T15:03:01+00:00

This is somewhat connected to this post, which I didn’t want to pollute. Active

  • 0

This is somewhat connected to this post, which I didn’t want to pollute.

Active Directory user password expiration date .NET/OU Group Policy

Like the OP in that thread, I’m trying to get the password expiration date of a given AD UserName via code; however the attribute maxPwdAge referred in the thread above is not available when I tried to get all the available properties like this:

            PropertyCollection fields = myLDAP.Properties;

            foreach (String ldapField in fields.PropertyNames)
            {
                // cycle through objects in each field e.g. group membership  
                // (for many fields there will only be one object such as name)  

                foreach (Object myCollection in fields[ldapField])
                    Console.WriteLine(String.Format("{0,-20} : {1}",
                                  ldapField, myCollection.ToString()));
            }

Even Microsoft’s ADExplorer didn’t show a password expiration date.

But when I try this command prompt command:

net user thatuser /DOMAIN

it displays Password Expiration Date.

My questions are:

  1. Why don’t I see maxPwdAge as an attribute
  2. Where does the net user command get the Password Expiration Date from and how can I obtain it in C# code?

Right now I’m testing this with a Console Application; while testing this, it was discovered that there isn’t .Net 4.0 installed on the target machine, so I’m stuck with .Net 3.5

I’m not a server admin, so I don’t know the configuration details of the server. I’m new to this AD LDAP, so please help. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:03:02+00:00Added an answer on June 17, 2026 at 3:03 pm

    maxPwdAge defines how long a password can be valid for, not when it expires.

    It is a property set at group level, not a user property.

    What you are interested in is probably maxPwdAge + pwdLastSet.

    (pwdLastSet is a user property)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Once and for all I want to clearify this somewhat subjective and argumentative area
I'm pretty new to this, so somewhat confused. I want to send OPTIONS converted
This is somewhat a continuation of this post I've taken the following code and
I apologize if this may seem like somewhat of a novice question (which it
Is it possible to have nested set capabilities in this somewhat custom setup? Consider
This is somewhat complex (well to me at least). Here is what I have
this is somewhat of an odd question. I wrote a C function. Its 'like'
This is somewhat of a sequel to Slow Exists Check . Alex's suggestion works
This is somewhat similiar to this : pthread function from a class But the
This is somewhat related to the question posed in this question but I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.