tags:

views:

30

answers:

2

Hi,

I want to create a program that will allow someone to add a user to a group. I don't want to give the user the ability to do this on the domain through their account. I want to use a separate username and password stored in the program that will be used. What documentation should I be reviewing?

+2  A: 

You could look at MSDN documentation for WindowsIdentity.Impersonate to see how to impersonate a different account.

As for storing the username and password in the program, the general advice is "don't do it", because it's insecure. Anyone who can reverse engineer your code will be able to discover the username and password.

Joe
A: 

For the actual domain operations, you'll probably want the System.Management assembly (which basically wraps WMI). http://msdn.microsoft.com/en-us/library/dwd0y33x.aspx

For the authentication prior to performing operations using System.Management, you should probably use a WindowsImpersonationContext: http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx

JeffN825