Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*!* username.prg
LOCAL lcUserName, lnLen, llRetVal
DECLARE GetUserName IN WIN32API String@, Integer@
lcUserName = SPACE(20)
lnLen = 20
llRetVal = GetUserName(@lcUserName, @lnLen)
RETURN IIF(llRetVAl, LEFT(ALLTRIM(lcUserName),LEN(ALLTRIM(lcUserName))-1), NULL)
On Error *
lcComputer = "."
loWMIService = GetObject("winmgmts:\\" + lcComputer + "\root\cimv2")
colItems = loWMIService.ExecQuery("Select * from Win32_NetworkLoginProfile")
For Each loItem in colItems
dtmWMIDate = loItem.AccountExpires
lcReturn = WMIDateStringToDate(dtmWMIDate)
?"Account Expires: " + lcReturn
?"Authorization Flags: " + loItem.AuthorizationFlags
?"Bad Password Count: " + loItem.BadPasswordCount
?"Caption: " + loItem.Caption
?"CodePage: " + loItem.CodePage
?"Comment: " + loItem.Comment
?"Country Code: " + loItem.CountryCode
?"Description: " + loItem.Description
?"Flags: " + loItem.Flags
?"Full Name: " + loItem.FullName
?"Home Directory: " + loItem.HomeDirectory
?"Home Directory Drive: " + loItem.HomeDirectoryDrive
dtmWMIDate = loItem.LastLogoff
lcReturn = WMIDateStringToDate(dtmWMIDate)
?"Last Logoff: " + lcReturn
dtmWMIDate = loItem.LastLogon
lcReturn = WMIDateStringToDate(dtmWMIDate)
?"Last Logon: " + lcReturn
?"Logon Hours: " + loItem.LogonHours
?"Logon Server: " + loItem.LogonServer
?"Maximum Storage: " + loItem.MaximumStorage
?"Name: " + loItem.Name
?"Number Of Logons: " + loItem.NumberOfLogons
?"Password Age: " + loItem.PasswordAge
dtmWMIDate = loItem.PasswordExpires
lcReturn = WMIDateStringToDate(dtmWMIDate)
?"Password Expires: " + lcReturn
?"Primary Group ID: " + loItem.PrimaryGroupId
?"Privileges: " + loItem.Privileges
?"Profile: " + loItem.Profile
?"Script Path: " + loItem.ScriptPath
?"Setting ID: " + loItem.SettingID
?"Units Per Week: " + loItem.UnitsPerWeek
?"User Comment: " + loItem.UserComment
?"User Id: " + loItem.UserId
?"User Type: " + loItem.UserType
?"Workstations: " + loItem.Workstations
?
Next
Function WMIDateStringToDate(dtmWMIDate)
If !IsNull(dtmWMIDate)
WMIDateStringToDate = CTOT(Substr(dtmWMIDate, 5, 2) + "/" + ;
Substr(dtmWMIDate, 7, 2) + "/" + Left(dtmWMIDate, 4) ;
+ " " + Mid (dtmWMIDate, 9, 2) + ":" + ;
Substr(dtmWMIDate, 11, 2) + ":" + Substr(dtmWMIDate, ;
13, 2))
ENDIF
ENDFUNC