Show 

wntAcctPolGet

Gets account policy information for a server.

Syntax:

wntAcctPolGet( server-name, request)

Parameters:

(s) server-name: the UNC name of the server on which the function will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate the current machine.

(i) request: specifies the information to be returned (see below).

Returns:

(i) an integer value.

 

"request" specifies the information to be returned, and can be one of the following:

Request

Returns

1

Minimum allowable password length.

2

Maximum allowable password age, in days, or -1 if passwords never expire.

3

Minimum elapsed time, in days, between when the password was last changed and when it can be changed again. A value of 0 indicates that no delay is required between password updates.

4

Amount of time, in seconds, between the end of the valid logon time and the time when the user is forced to log off the network, or -1 if users are never forced to log off. A value of 0 indicates that users will be forced to log off immediately when the valid logon time expires.

5

Length of password history maintained (ie, the number of previous passwords stored in the password history buffer). A new password cannot match any of the passwords in the buffer.

6

Lockout duration, in minutes (ie, the amount of time that a locked account will remain locked before being automatically unlocked).

7

Maximum time, in minutes, between any two failed logon attempts for lockout to occur.

8

Number of invalid password authentications for which an account is to be marked as locked out.

 

Note: This function can only be performed by members of the Administrators or Account Operators local group.

 

Example:
; Load Appropriate Extender
AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')

 
passlen=wntAcctPolGet("", 1) Message("Minimum allowable password length=", passlen)
passage=wntAcctPolGet("", 2) Message("Maximum allowable password age for pass to expire","%passage% days (-1 if passwords never expire)")
passelapsed=wntAcctPolGet("", 3) Message("Minimum elapsed time between when pass last changed","%passelapsed% in days, or 0 if no delay is required between changes")
forcedlogofftime=wntAcctPolGet("", 4) Message("Amount of time before forced log off","%forcedlogofftime% seconds (-1 if users are never forced to log off)%@crlf%(0=users will be forced to log off immediately when valid logon time expires.")
 
numprevpasses=wntAcctPolGet("", 5) Message("Number of previous passwords stored","%numprevpasses% passwords stored")
 
lockoutduration=wntAcctPolGet("", 6) Message("Lockout duration","%lockoutduration% minutes")
 
maxtimefailedpass=wntAcctPolGet("", 7) Message("Maximum time between any two failed logon attempts","%maxtimefailedpass% minutes")
 
numinvalidpass=wntAcctPolGet("", 8) Message("Number of invalid password authentications for which an account is to be marked as locked out.","%numinvalidpass% password authentications allowed") Exit
See Also:

wntAcctPolSet, wntAcctInfo