TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
hanumanth reddy
NA
15
13.5k
How to get maxPwdAge by OrganizationUnit or Group wise in AD
Dec 19 2014 1:28 PM
I want to get maxPwdAge value for specific Organization Unit or Group wise.Anybody help me how to do it.
I am able to get domain level maxPwdAge like below
long maxPwdAge=0;
string domain="LDAP://10.10.1.100/OU=Dev,DC=test,DC=com";
string adsiUserName="test";
string adsiPassword="test";
DirectoryEntry entry = new DirectoryEntry(domain, adsiUserName, adsiPassword, AuthenticationTypes.Secure);
DirectorySearcher mySearcher = new DirectorySearcher(entry);
string filter = "(maxPwdAge=*)"; //"maxPwdAge=*";
mySearcher.Filter = filter;
SearchResult results = mySearcher.FindOne();
if (results != null)
{
Int64 pwdAge = (Int64)results.Properties["maxPwdAge"][0];
maxPwdAge = pwdAge / -864000000000;
}
Reply
Answers (
0
)
Show Gridview in PopUp Box (MVC4)
this store proceser how can bind gridview