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.
#DEFINE JUST_EXPLORER_USERS .F.
LOCAL WMIService
LOCAL Processes
LOCAL Process
LOCAL Username AS String
LOCAL Domain AS String
CREATE CURSOR LoggedUsers (Username Varchar(64), Domain varchar(64))
m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
#IF JUST_EXPLORER_USERS
m.Processes = m.WMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Caption = 'explorer.exe'",,48)
#ELSE
m.Processes = m.WMIService.ExecQuery("SELECT * FROM Win32_Process",,48)
#ENDIF
FOR EACH m.Process IN m.Processes
m.Username = ""
m.Domain = ""
IF m.Process.GetOwner(@m.Username, @m.Domain) = 0
LOCATE FOR Username == m.Username AND Domain == m.Domain
IF !FOUND()
INSERT INTO LoggedUsers VALUES (m.Username, m.Domain)
ENDIF
ENDIF
ENDFOR
BROWSE
dkean4 said:list all users on a PC
Local lcAllProfiles, lnRow
lcAllProfiles = Fullpath("..\",ADDBS(GETENV("USERPROFILE")))
FOR lnRow = 3 TO ADIR(laUsers,lcAllProfiles+"*","D",1)
? laUsers[lnRow,1]
ENDFOR
Code Output of Olaf said:Classic .NET AppPool
DefaultAppPool
Dennis
Public
Simply
wordpress
xDocMessaging]
#DEFINE JUST_LOCAL_ACCOUNTS .T.
LOCAL WMIService
LOCAL Accounts
LOCAL Account
LOCAL Username AS String
LOCAL Domain AS String
CREATE CURSOR UserAccounts (Username Varchar(64), Domain varchar(64))
m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
#IF JUST_LOCAL_ACCOUNTS
m.Accounts = m.WMIService.ExecQuery("SELECT * FROM Win32_UserAccount WHERE LocalAccount = 1",,48)
#ELSE
m.Accounts = m.WMIService.ExecQuery("SELECT * FROM Win32_UserAccount",,48)
#ENDIF
FOR EACH m.Account IN m.Accounts
INSERT INTO UserAccounts VALUES (m.Account.Name, m.Account.Domain)
ENDFOR
BROWSE
#DEFINE JUST_LOCAL_ACCOUNTS .F.