Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
User = "sid" Password = "nancy" ComputerName = "computer123" Locator = ObjectOpen("WbemScripting.SWbemLocator") ;Service = Locator.ConnectServer() Service = Locator.ConnectServer(ComputerName,"root/cimv2",User,Password) Security = Service.Security_ Security.ImpersonationLevel = 3 Class = "Win32_ComputerSystem" Instance = Service.InstancesOf(Class) hEnum = ObjectCollectionOpen(Instance) While 1 Obj = ObjectCollectionNext(hEnum) If Obj == 0 Then Break LUser = Obj.UserName EndWhile ObjectCollectionClose(hEnum) ObjectClose(Instance) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) message ("RESULTS", StrCat("'",LUser, "' is currently logged on to '",computername,"'"))
Article ID: W16753
File Created: 2005:02:18:12:22:14
Last Updated: 2005:02:18:12:22:14