I doubt the account you are using has WMI permissions.

Verify using these instructions http://technet.microsoft.com/en-us/library/cc787533(WS.10).aspx

On Fri, Jan 29, 2010 at 12:43 PM, aki <aki275@googlemail.com> wrote:


On Fri, Jan 29, 2010 at 12:20 PM, Simon Mbuthia <simon.mbuthia@gmail.com> wrote:
I had also removed the filter and it still behaved the same. I am 100000000% sure that the code is perfect, just like the C# snippet has vindicated. Anyway, I run the C# application and got the message below:

Unhandled Exception: System.UnauthorizedAccessException
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 e
rrorCode, IntPtr errorInfo)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.Mo
veNext()
   at WMISample.MyWMIQuery.Main()

Still looks like something to do with permissions... but which user needs to have permission to what?? That's my question. My account has full permissions on wscript.exe, cscript.exe and even scrrun.dll

 
@Simon, try these and check permissions ( from run ) :
 

Wmimgmt.msc     ( and right click on properties. Click security tab and check root )

or

Wbemtest.exe

Your WMI log files are at : %SystemRoot%\system32\wbem\logs

Beyound this, as a learner am out of ideas. poolay! :-)

 

 

 

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science:  http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi:     http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general