I'm working on a program that will add a user on the domain to a particular PC's local admin group.
Here's the code from VBScript, that works:
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
And here is the code that I'm using in VB.NET:
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
When I click "Button1", no changes are made 
Any help would be very much appreciated! Thanks.
	
		
			
		
		
	
				
			Here's the code from VBScript, that works:
			
				VB.NET:
			
		
		
		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."
			
				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 & "/Administrators")
        Dim objUser = GetObject("WinNT://DOMAIN/USERNAME HERE")
        objGroup.Add(objUser.ADsPath)
    End Sub
Any help would be very much appreciated! Thanks.
 
	