Author: gaurav_majithia | Posted on: 3/9/2010 8:51:13 AM | Views : 366

Hi Folks,
May be this is a re post, But i am still looking for a proper code which can help me do this work.
I have few vbscripts which can help me do this but i need to do it using ASP.NET.
Below is the vb sctipt which will do this.
Dim DomainName Dim UserAccount Set net = WScript.CreateObject("WScript.Network") local = net.ComputerName DomainName = "DomainName" UserAccount = "userAccount" set group = GetObject("WinNT://"& local &"/Administrators") on error resume next group.Add "WinNT://"& DomainName &"/"& UserAccount &"" CheckError sub CheckError if not err.number=0 then set ole = CreateObject("ole.err") MsgBox ole.oleError(err.Number), vbCritical err.clear else MsgBox "Done." end if end sub
 
...

Go to the complete details ...