0 out of 3 rated this helpful - Rate this topic

WinNT Custom User Properties

The WinNT provider makes available the following custom properties for the User class. They may be accessed through the IADs.Get and IADs.Put methods. For more information, see the USER_INFO_3 structure.

PropertyTypeDescription
HomeDirDriveStringHome Directory Drive of the user. This is a pointer to a Unicode string that specifies the path of the home directory. The string can be null. See example in this topic.
ObjectSIDOctet StringObject SID of the user. For an example of how to retrieve the Object SID using the WinNT Provider, see Object SID (WinNT Provider)
ParametersStringParameters of the user. Points to a Unicode string that is set aside for use by applications. This string can be a null string, or it can have any number of characters before the terminating null character. Microsoft products use this member to store user configuration data. This property can only be modified by an application during installation.
PasswordAgeTimeTime duration of the password in use. This property indicates the number of seconds that have elapsed since the password was last changed.
PasswordExpiredIntegerTells when the password was expired. When you use Get, it will return zero is the password has not expired, or nonzero if it has expired. See example in this topic.
PrimaryGroupIDIntegerUser's primary group ID, for example, domain user group ID. See example in this topic.
UserFlagsIntegerUser Flag defined in ADS_USER_FLAG_ENUM. For an example of how to use UserFlags, see Password Never Expires (WinNT Provider)

 

This example shows how to set a user's Home Drive Directory.

Dim usr As Object

Set usr = GetObject("WinNT://Fabrikam/jsmith,user") 
usr.HomeDirectory = "UserHomeDirHere"
usr.HomeDirDrive = "HomeDirDriveHere"
usr.SetInfo

This example shows how to use PasswordExpired to force a user to change the password at the next logon.

Dim usr As Object

Set usr = GetObject("WinNT://Fabrikam/jsmith,user")
usr.Put "PasswordExpired", CLng(1)
usr.SetInfo 

'--- Clear this flag so that the user does not have to change the password at next logon.

usr.Put "PasswordExpired", CLng(0)
usr.SetInfo

This example shows how to get the user's primary group.

Dim usr As Object
Dim grpPrimaryID As Object

Set usr = GetObject("WinNT://Fabrikam/jsmith,user") 
grpPrimaryID = usr.Get("PrimaryGroupID")

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ