473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

OID Properties

Hi
I am trying to find the passwordexpirationdate for a user. I am able to get that in active directory. The code is as follows
using (Domain domain = Domain.GetCurrentDomain())
using (DirectoryEntry domainEntry = domain.GetDirectoryEntry())
{
long maxAge;
IADsLargeInteger largeIntMaxAge = domainEntry.Properties["MaxPwdAge"].Value as IADsLargeInteger;
maxAge = (((long)(largeIntMaxAge.HighPart) << 32) + (long)largeIntMaxAge.LowPart);

DirectoryEntry user = new DirectoryEntry("ladap path", null, null, AuthenticationTypes.ServerBind);
user = Entry;
IADsLargeInteger largeInt = user.Properties["pwdlastset"].Value as IADsLargeInteger;
long expDate = (((long)(largeInt.HighPart) << 32) + (long)largeInt.LowPart) - maxAge;

DateTime dt = DateTime.FromFileTime(expDate);

}

Now I want to find the passwordexpirationdate for user in OID. I could not find any related properties(or attributes) there. Please suggest me a way out of this

Thanks
Nov 13 '07 #1
1 1241
Plater
7,872 Expert 4TB
You might be able to find something useful from this article?
http://en.csharp-online.net/User_Man...ord_Expiration

I am unfamiliar with using the active directory withen .net though, so I can't help with specifics.
Nov 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Lyn | last post by:
Hi, This question may seem a bit academic... To learn more about Access VBA, I have been enumerating the properties of various form controls. This was mostly successful and I have learned a lot...
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
1
by: Christophe Peillet | last post by:
I have a CompositeControl with two types of properties: 1.) Mapped Properties that map directly to a child control's properties (ex.: this.TextboxText = m_txt.Text). These properties are handled...
7
by: Anderskj | last post by:
Hi! I am developing a c# application. I have a interface (which can change therefore my problem) If i do like this: List<PropertyInfoproperties = new List<PropertyInfo>();...
0
by: =?Utf-8?B?UmljayBHbG9z?= | last post by:
For some unknown reason (user error?), I cannot get a NameValueCollection to persist in the app.config file. Unlike other settings, I cannot get the String Collection Editor GUI to allow my to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.