GetObject
functionality in Team Developer, widely used in scripting languages like JScript and VbScript.The sample shows the usage of WMI and has a ready to go function
PALActiveXGetObject
, which is a wrapper for GetObject.Sample of the usage to query the logged on user using WMI
Code: Select all
If PALActiveXGetObject( '', "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2", uService, uError )
! Get the collection
If uService.ExecQuery1( "Select * from Win32_ComputerSystem", uWbemObjectSet )
Call uWbemObjectSet.PropGetCount( nTotal )
!
While uWbemObjectSet.Next( uComputer )
Call uComputer.PropGetUserName( sName )
Call SalMessageBox( sName || " is logged on", "Msg", MB_Ok )
Article and source sample can be found here:
https://wiki.tdcommunity.net/index.php/A ... workaround