|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Query VMI with limited right usersabout the comuter. The method work well when we run the application with a user having administration right. However, when we run the application with a user not having adminstration right (standart user) the following execption is throw. System.Management.Managementexception: Initialization failure at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorcode) at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext() Does someone have a idea how to make it works? Here is the code: Dim l_uin as string Dim query As New SelectQuery("Win32_WindowsProductActivation") ' Instantiate an object searcher with this query Dim searcher As New ManagementObjectSearcher(query) ' Call Get() to retrieve the collection of objects and loop through it For Each envVar As ManagementObject In searcher.Options.Get() l_uin = CStr(envVar("ProductID")) Next envVar Regards, |
|||||||||||||||||||||||