HighTechTalks DotNet Forums  

"Access Denied" when getting MAC addresses with System.Management.ManagementClass

Dotnet Framework microsoft.public.dotnet.framework


Discuss "Access Denied" when getting MAC addresses with System.Management.ManagementClass in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Orbian
 
Posts: n/a

Default "Access Denied" when getting MAC addresses with System.Management.ManagementClass - 01-02-2008 , 03:08 PM








Hello,

I am having trouble getting the MAC addresses on some machines using
the Management class. The code below works on most machines, but on
some I get an "Access Denied" exception when performing a
GetInstances() call on some machines. Any ideas on what might be
causing this? Is there any other way to get the MAC adresses?


System.Management.ManagementClass mc;
mc = new
System.Management.ManagementClass("Win32_NetworkAd apterConfiguration");

System.Management.ManagementObjectCollection moc;
moc = mc.GetInstances(); // Throws "Access Denied" exception.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.