Пример #1
0
        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);
        }
Пример #2
0
        public void GetDomainPolicy()
        {
            DirectoryEntry root = TestUtils.GetDefaultPartition();

            using (root)
            {
                DomainPolicy policy = new DomainPolicy(root);

                Console.WriteLine(policy.DomainDistinguishedName);
                Console.WriteLine(policy.PasswordHistoryLength);
                Console.WriteLine(policy.MaxPasswordAge);
                Console.WriteLine(policy.LockoutDuration);
                Console.WriteLine(policy.MinPasswordLength);
            }
        }
Пример #3
0
        public PasswordExpires()
        {
            DirectoryContext ctx = new DirectoryContext(
                DirectoryContextType.Domain
                );

            //get our current domain policy
            Domain         domain = Domain.GetDomain(ctx);
            DirectoryEntry root   = domain.GetDirectoryEntry();

            using (domain)
                using (root)
                {
                    _policy = new DomainPolicy(root);
                }
        }
Пример #4
0
 public PasswordExpires(DomainPolicy policy)
 {
     _policy = policy;
 }