Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'==========================================================================
'
' NAME: AddUserToLocalAdminGroup.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 8/8/2004
'
' COMMENT: <comment>
'
'==========================================================================
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
'Edit the next line with your new domain name and admin account name
DomainString = "DomainName\Administrator"
'Add the user to the local admins group
Call WSHShell.Run("cmd.exe /C net localgroup administrators " & DomainString & " /add")
'==========================================================================
'
' VBScript Source File --
'
' NAME: RemoteExecute.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL : [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 3/8/2004
'
' COMMENT: Remotely Executes Adding Users to Local Admin Group.
'
'==========================================================================
On Error Resume Next
'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'open the data file
Set oTextStream = oFSO.OpenTextFile("wslist.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close
For Each strWorkstation In RemotePC
'Do something useful with strWorkstation
If Not oFSO.FolderExists("\\"&strWorkstation&"\c$\Scripts") Then
Call WSHShell.Run("cmd.exe /C md \\" & strWorkstation & "\c$\Scripts")
End If
If Not oFSO.FileExists("\\"&strWorkstation&"\c$\Scripts\AddUserToLocalAdminGroup.vbs") Then
Call WSHShell.Run("cmd.exe /C copy C:\AddUserToLocalAdminGroup \\"&strWorkstation&"\c$\Scripts")
End If
wscript.sleep 200
If Not oFSO.FileExists("\\"&strWorkstation&"\c$\psexec.exe") Then
Call WSHShell.Run("cmd.exe /C copy C:\psexec.exe \\"&strWorkstation&"\c$")
End If
wscript.sleep 200
Call WSHShell.Run("cmd.exe /c c:\psexec.exe \\" & strWorkstation & " -s -i cmd.exe /C C:\Scripts\AddUserToLocalAdminGroup.vbs")
Next
Set oFSO = Nothing
Msgbox "All done"
WScript.Quit(0)