API

Introduction

Specops Password Policy Basic provides an Application Programming Interface (API) for creating, managing and deleting fine-grained password policies. Both the adminstration tool and CmdLets utilizies this API and it can can be used by third party developers to automate or integrate the administrative tasks of Specops Password Policy Basic.

Reference

Namespace: SpecopsSoft.SpecopsPasswordPolicyBasic

Assembly: SpecopsPasswordPolicyBasicApi.dll

PasswordPolicies class

The PasswordPolicies class encapsulates fine-grained password policies.

Constructors

PasswordPolicies() Initialies a new instance of the PasswordPolicies class that contains password policies for the current domain.

PasswordPolicies(string domain) Initialies a new instance of the PasswordPolicies class that contins password policies for the given domain. Domain name can be the NetBIOS or DNS name.

Methods

public bool IsSupported() Determines if the domain functionaly level of the current domain is Windows Server 2008 or higher.

public bool IsSupported(string domainName) Determines if the domain functionaly level of the given domain is Windows Server 2008 or higher. Can be the NetBIOS or DNS name.

public PasswordPolicy Add(string policyName) Creates a new PasswordPolicy object with given name.

public void Remove(string policyName) Removes a password policy by name.

public void Remove(PasswordPolicy policy) Removes a password policy by an existing PasswordPolicy instance.

public bool Exists(string policyName) Determines if a given policy already exists.

public PasswordPolicy Find(string policyName) Returns the member of this collection with the specified name.

public PasswordPolicy Find(Guid guid) Returns the member of this collection with the specified Guid.

public void Sort() Sorts this collection by policy Precedence and Guid.

public PasswordPolicy GetAffectingPasswordPolicy(string user) Returns the affecting PasswordPolicy for the given user by name, otherwise null.

public PasswordPolicy GetAffectingPasswordPolicy(DirectoryEntry directoryEntry) Returns the affecting PasswordPolicy for the given user by DirectoryEntry, otherwise null.

public IEnumerator GetEnumerator() Returns an enumerator that iterates through the collection.

public void Dispose() Releases all resources used by the PasswordPolicies instance.

Properties

public int Count { get; } Gets the number of password policies in this collection.

PasswordPolicy class

The PasswordPolicy class encapsulates one fine-grained password policy.

Methods

public void AddMember(string userName) Adds a new member by name to the list of members that this PasswordPolicy applies to.

public void AddMember(DirectoryEntry directoryEntry) Adds a new member by DirectoryEntry to the list of members that this PasswordPolicy applies to.

public void RemoveMember(string userName) Removes an existing member from the list of members that this PasswordPolicy applies to.

public void RemoveAllMembers() Removes all members from the list of members that this PasswordPolicy applies to.

public void Save() Updates the entry for this PasswordPolicy in Active Directory.

public int CompareTo(PasswordPolicy otherPolicy) Compares the Precedence and Guid properties of this instance to the Precedence of a specified PasswordPolicy object.

public void Dispose() Disposes of the resources that are used by this PasswordPolicy object.

Properties

public string Name { get; set; } The name of the password policy.

public Guid Guid ( get; } The Guid of the password policy.

public int Precedence { get; set; } Precedence between different policies.

public bool ComplexityEnabled { get; set; } Complexity enabled.

public int? MinimumPasswordAge { get; set; } Minimum password age in days.

public int? MaximumPasswordAge { get; set; } Maximumum password age in days.

public int MinimumPasswordLength { get; set; } Minimum password length.

public int PasswordHistoryLength { get; set; } Password history length in number of remembered passwords.

public bool ReversibleEncryptionEnabled { get; set; } Reversible encryption enabled.

public int? LockoutDuration { get; set; } The number of minutes that that a locked account will remain locked out. If the value is null the account will be locked until an administrator opens it.

public int? LockoutThreshold { get; set; } The number of failed logon attempts allowed before the account is locked out. If this value is null, the password will never be locked out.

public int? LockoutResetCounter { get; set; } The number of minutes that need to pass before the number of failed password attempts is reset. If the value is null then the failed password attempts counter is only reset by a successful logon.

public ReadOnlyCollection<DirectoryEntry> Members { get; } Returns a collection of members that this password policy affects.

PasswordPolicyException classes

The following exceptions can be thrown by metods exposed in classes PasswordPolicies and PasswordPolicy:

  • PasswordPolicyAlreadyExistsException
  • PasswordPolicyCreateException
  • PasswordPolicyInvalidMemberException
  • PasswordPolicyMemberInvalidDomainException
  • PasswordPolicyMemberNotFoundException
  • PasswordPolicyNotSupportedException
  • PasswordPolicySaveException

Page last modified on November 09, 2007, at 11:54 AM