The user object can be used to retrieve user information.
Properties | Description |
CurrentDomain | Domain name for the currently logged on user |
CurrentUser | User name for the currently logged on user |
Groups | Reference to the user groups collection |
LogonServer
|
Name of the domain controller to which the user is currently loggend on
|
Methods | Description |
GetLastLogon
|
Retrieve the last logon timestamp. The function returns a Date value. Function GetLastLogon(Domain As String, UserName As String) |
GetUserFullName
|
Retrieve the user’s full name from the active directory. The function returns a String value. Function GetUserFullName(Domain As String, UserName As String) |
UserGroups
|
Retrieve all group member ships from the active directory. The function returns a Boolean value. (True if successful) Function UserGroups(Domain As String, UserName As String) |
Usage:
Sub Scense_Main() Dim grp With User 'Retrieve info WriteScenseLog .GetLastLogon(.CurrentDomain, .CurrentUser) WriteScenseLog .GetUserFullName(.CurrentDomain, .CurrentUser) 'Retrieve groups If .UserGroups(.CurrentDomain, .CurrentUser) Then 'Enumerate groups For Each grp In .Groups WriteScenseLog grp.GroupName Next End If End With End Sub