Hi,
I am trying to check for locked accounts in AD. In a few snippets of code, such as http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5e0fadc2-f27b-48f6-a6ac-644e12256c67/, the code is using the DomainPolicy object, as in:
DirectoryContext context;
DirectoryEntry root;
DomainPolicy policy;
public Lockout(string domainName)
{
this.context = new DirectoryContext(
DirectoryContextType.Domain,
domainName
);
//get our current domain policy
Domain domain = Domain.GetDomain(this.context);
this.root = domain.GetDirectoryEntry();
this.policy = new DomainPolicy(this.root);
}
I'm using C#3.0 and the .NET framework 3.5 but I can't seem to find the DomainPolicy object, where does it sit? I've had a look and it appears it is a readonly property of HostSecurityManager.