Can anyone help with C# and WMI??? I’m STUCK!

19 07 2006

I am trying to create a tool for new user creation so that our Help Desks can create users, home directories, the shares, and add them to

It was all good until I got to creating shares on the servers (some are DC’s)  I can’t find ANY WAY to get around the following (in C#):

System.Management.ManagementClass mc =
      new System.Management.ManagementClass(“\\\\” + oHomeServer.Text.Trim() +
      “\\root\\cimv2”, “Win32_Share”, null);
System.Management.ManagementBaseObject inParams = mc.GetMethodParameters(“Create”);

I get “Access Denied” exception when I run this as a NON-Admin user in the HelpDesk Group.  I have given ALL rights to the WMI services to the
“HelpDesk Group” on server which I am creating the share.  It won’t let me 😦

When I log into a PC as that user, and run through computer management/attach to server and then go through “Create a new share”, it all works great… Directory is created, share is created etc.  This would indicate to me that the user has rights to do this, but that the code being called by the tool is different than the code that _I_ am calling 😦
What rights do I need for the HelpDesk Group on what aspects of what object for this to work?   What code should I call instead? I have
brick shaped dent in my forehead from this problem, and the balding patch is growing larger from pulling all my hair out!!!!

So, all you WMI and security gurus out there… help please.

Heck, even if you don’t know the answer, but know someone who MIGHT know the answer, I’d appreciate it… either leave a comment or use the Contact Link.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: