Hello All,
I am using Visual Studios 2005 to create an application that will add domain users across the network to the local administrators group of a particular PC. I have the code working in a VBScript; however the VB code doesn't seem to work.
Here is the code from VBScript:
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
strComputer = "PC NAME HERE"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://DOMAIN/USERNAME")
objGroup.Add(objUser.ADsPath)
wscript.echo "Local Admin Added."
Here is the code I enter to VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim FSO
FSO = CreateObject("Scripting.FileSystemObject")
Dim strComputer = "PC NAME HERE"
Dim objGroup = GetObject("WinNT://" & strComputer & "/Adm ...
Go to the complete details ...