Support
Authorization

Newsletter

  Settings

RAdmin 3.3 Automated Installation

 

Forums list
Topics list
New topics
Search
Rules
Help
Login: 
Register

Pages: 1
  Views: 15923Topic: pinned: «RAdmin 3.3 Automated Installation, VBS Script to install RAdmin Server 3.3» on forum: Network management general discussion
#1
smile:idea:
I thought I might post this to help some of you out there who are trying to upgrade your clients to RAdmin Server 3.3. I openly admit that I am far from being any sort of developer, so please feel free to toss out suggestions for improving the VBScript code. The code below also cleans up any remnants from older versions, such as dead icons or folders.

The script below was used to uninstall older RAdmin Server clients from over 5,000 computers, which worked nicely. I have summarized how I did it below for anyone who might be interested.

Bon appetite.

1. Installed the RAdmin Activation Server, available on this web site.
2. Installed the RAdmin Deployment Tool, available on this site.
3. Created a new MSI package with my specific RAdmin Server settings.
4. Pointed the newly created MSI package at my RAdmin Activation server.
5. Created a RAdmin deployment services account in Active Directory.
6. Created a RAdmin deployment security group.
7. Added my service account to the RAdmin security group.
8. Created a Restricted Groups GPO and added my RAdmin security group and applied it to the Local Administrators group (http://www.windowsecurity.com/articles/Using-Restricted-Groups.html).
9. Bundled my VBscript into an executable, elevating the privileges for the installation, which used my service account (A sort of RunAs). I used the “Admin Script Editor” packaging tool to create this executable, which allowed me to update all nodes, regardless if they were “locked down” or not. (http://adminscripteditor.com/editor/scriptpackager).
10. Deployed the executable in a login script.

Note: For older RAdmin versions (i.e. 2.0, 2.2, etc) that were silently installed using a BAT file or VBScript, you can use the commands below to uninstall older versions. The reason is that when you silently install older RAdmin versions, it only installs services and DLL’s, so there is no uninstall string in the registry.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
BAT File to Silently Uninstall Older Versions that were Silently Installed (i.e. 2.0, 2.2)
@echo off
C:\windows\system32\r_server.exe /stop
C:\windows\system32\r_server.exe /unregister
C:\windows\system32\r_server.exe /uninstall /silence


VBScript to Uninstall Previous RAdmin Server Clients and Install RAdmin 3.3
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Automated RAdmin Update Script to install RAdmin 3.3 Server
''' The script uninstalls all previous RAdmin Versions start at v2.
''' Written by Andrew Nova for HUB International, December 2008
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

On Error Resume Next
strComputer = "."
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKLM = &H80000002
Const OverwriteExisting = True
Const DeleteReadOnly = True

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

KeyExists = "0"
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
MyFileServer = "\\YourFileServer\YourFolder\YourSUBfolder\"

Set objNetwork = CreateObject("Wscript.Network") 'get the current computer name
objComputerName = objNetwork.ComputerName

''' Get Windows Default Directory
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")

For Each objItem In colItems
WinDir = objItem.WindowsDirectory
Next

''' Create Software Folder if it doesnt exist
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FolderExists("C:\RAdmin.Software") Then
Set objFolder = objFSO.CreateFolder("C:\RAdmin.Software")
End If


''' Create the version Array
Dim MyRVersion(6)
MyRVersion(0) = "Remote Administrator v2.0"
MyRVersion(1) = "Remote Administrator v2.1"
MyRVersion(2) = "Remote Administrator v2.2"
MyRVersion(3) = "Radmin Server 3.0"
MyRVersion(4) = "Radmin Server 3.1"
MyRVersion(5) = "Radmin Server 3.2"
MyRVersion(6) = "Radmin Server 3.3"

''' Loop through the Array to see what versions are installed.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
For x = 0 To 6

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & "root\default:StdRegProv")
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "DisplayName", DisplayName

If DisplayName = MyRVersion(x) Then
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "UninstallString", UninstallString

If DisplayName = "Radmin Server 3.3" Then
WScript.quit
End If

RAdminVersion = Left(DisplayName,20)

If RAdminVersion = "Remote Administrator" Then

Uninstallme = WinDir & "\system32\r_server.exe /uninstall /silence"
DelSFile = WinDir & "\system32\r_server.exe"
DelDLL = WinDir & "\system32\raddrv.dll"
MyRAFolder = "C:\Documents and Settings\All Users\Start Menu\Programs\" & DisplayName
RAFolder = "C:\Documents and Settings\All Users\Start Menu\Programs"

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(MyRAFolder & "\*"), DeleteReadOnly

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder(RAFolder & "\Remote Administrator*")

Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & DisplayName
objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath

Set objShell = CreateObject("WScript.Shell")
objShell.Run Uninstallme, ,True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile DelSFile,True
objFSO.DeleteFile DelDLL,True

Else

MyNewString = Replace(Uninstallstring,"MsiExec.exe /X","")
MyUnInstall = "MsiExec.exe /norestart /q/x" & MyNewString & " /L*V " & "C:\RAdmin.Software\RAdmin.Uninstall.log"

Set objShell = CreateObject("WScript.Shell")
objShell.Run MyUnInstall, ,True

End If
End If
Next
Next


''' Copy MSI file to the C drive.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile MyFileServer & "RAdmin.3.3.Install.msi" , "C:\RAdmin.Software\", OverwriteExisting


''' Set the MSI Install Command and install package
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
RScommand = "C:\RAdmin.software\RAdmin.3.3.Install.msi" & " REBOOT=ReallySuppress /Quiet" & " /L*V " & _
"C:\RAdmin.Software\RAdmin.3.3.Install.log"

Set WshShell = WScript.CreateObject("WScript.Shell")
Set objShell = CreateObject("WScript.Shell")
objShell.Run RScommand, ,True

WScript.quit
Profile
#2
I'm modifying this script to uninstall our current installation of v 3.4 and reinstall with an adjusted msi file. Ideally, this would be a completely silent uninstall / install that I can add into another package release. As such, I'm looking at this line:

Quote
Uninstallme = WinDir & "\system32\r_server.exe /uninstall /silence"


Which points to a file that doesn't appear to exist in 3.4. There is a folder (%SystemRoot%\system32\rserver30) that appears to be the same, but the executables in that folder do not appear to take the /uninstall or /silence switch. Is there a file that I am missing?

Also, I'm trying to remove the current installed licence to apply a new one with the updated msi. I notice that the uninstaller removes most of the registry keys related RAdmin (including what appears to contain the licence information), but when I perform a re-installation of the software, it appears to have retained the licence.

Is there another file / location where the licence is cached?
Edited: Running Gag 03/01/2010 15:03:35
Profile
#3
v3.0 -> shared -> parameters -> xferparam -> 1
Profile
#4
Quote
Eugene Idzikovsky wrote:
v3.0 -> shared -> parameters -> xferparam -> 1


Thank you for the reply; I was able to find that with some digging. Somewhat curious that it was decided to leave the license key in the registry even after an uninstall. An uninstall should remove all elements of an application from the system; I shouldn't have to be rooting through the registry to find it's leavings.

Anyway, I decided to go a slightly different rout with what I am doing. We have a number of PCs that are imaged and have RAdmin pre-installed. Because the image is built on one machine and distributed to others with different hardware, the software reverts back to demo mode and requires activation after 30 days (even though it still has the valid key).

So, its either, a) have our NOC activate each one as they come up, b) distribute the license key to the field, or c) build a script. I've attached it in case anyone has run into the same issue as us.



' ----------------------------------------------------------------------------'
' RAdmin_Update.vbs
'
' This script deletes the current RAdmin license key, and applies and
' activates one provided in the script.
'
' Created - March 2010
' ----------------------------------------------------------------------------'

Option Explicit

' ----------------------------------------------------
' -- Declare and set objects and variables --
' ----------------------------------------------------

Dim strRegKey, strLicenseKey, strActivCmd
Dim counter
Dim objShell

' RAdmin license key
strLicenseKey = "xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx"

strRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\RAdmin\v3.0\Shared\Parameters\XferParam\"
strActivCmd = "C:\WINDOWS\system32\rserver30\rserver3.exe /activate /key:" & strLicenseKey

Set objShell = CreateObject("WScript.Shell")


' -----------------------
' -- Process --
' -----------------------

' Delete the registry keys that hold license information (There is the possibility of having more
' than one key installed so this removes up to 5 keys; expand as needed)
for counter = 1 to 5
On Error Resume Next
objShell.RegDelete strRegKey & counter & "\"
On Error Goto 0
Next

' Run the command that adds and activates the provided key
objShell.Run (strActivCmd)

Wscript.Echo "RAdmin Server 3.4 license updated and activated"


' -------------------------
' -- Cleanup --
' -------------------------

Set strRegKey = Nothing
Set strLicenseKey = Nothing
Set strActivCmd = Nothing
Set counter = Nothing
Set objShell = Nothing

Wscript.quit
Edited: Running Gag 03/02/2010 10:11:23
Profile
#5
Please DO NOT use activated Radmin in images. Radmin activation is hardware-bound and we advice you using Radmin trial version on images and then activating it after the deployment to avoid this kind of issue.

Also you can use a preconfigured .msi with your license key in order to mass deploy Radmin.
Profile
#6
Quote
Eugene Idzikovsky wrote:
Please DO NOT use activated Radmin in images. Radmin activation is hardware-bound and we advice you using Radmin trial version on images and then activating it after the deployment to avoid this kind of issue.


...

We have several thousand machines that we image every year; it is not practicable to activate them all by hand.

Quote
Also you can use a preconfigured .msi with your license key in order to mass deploy Radmin.


Or, I can create a script that is part of the deployment, and that utilizes built in features of the application, and runs silently so that it doesn't require user interaction. My way seems easier.
Profile
#7
Quote
Andrew Nova wrote:
smile:idea:

I thought I might post this to help some of you out there who are trying to upgrade your clients to RAdmin Server 3.3. I openly admit that I am far from being any sort of developer, so please feel free to toss out suggestions for improving the VBScript code. The code below also cleans up any remnants from older versions, such as dead icons or folders.



The script below was used to uninstall older RAdmin Server clients from over 5,000 computers, which worked nicely. I have summarized how I did it below for anyone who might be interested.



Bon appetite.



1. Installed the RAdmin Activation Server, available on this web site.

2. Installed the RAdmin Deployment Tool, available on this site.

3. Created a new MSI package with my specific RAdmin Server settings.

4. Pointed the newly created MSI package at my RAdmin Activation server.

5. Created a RAdmin deployment services account in Active Directory.

6. Created a RAdmin deployment security group.

7. Added my service account to the RAdmin security group.

8. Created a Restricted Groups GPO and added my RAdmin security group and applied it to the Local Administrators group (http://www.windowsecurity.com/articles/Using-Restricted-Groups.html).

9. Bundled my VBscript into an executable, elevating the privileges for the installation, which used my service account (A sort of RunAs). I used the “Admin Script Editor” packaging tool to create this executable, which allowed me to update all nodes, regardless if they were “locked down” or not. (http://adminscripteditor.com/editor/scriptpackager).

10. Deployed the executable in a login script.



Note : For older RAdmin versions (i.e. 2.0, 2.2, etc) that were silently installed using a BAT file or VBScript, you can use the commands below to uninstall older versions. The reason is that when you silently install older RAdmin versions, it only installs services and DLL’s, so there is no uninstall string in the registry.



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

BAT File to Silently Uninstall Older Versions that were Silently Installed (i.e. 2.0, 2.2)

@echo off

C:\windows\system32\r_server.exe /stop

C:\windows\system32\r_server.exe /unregister

C:\windows\system32\r_server.exe /uninstall /silence





VBScript to Uninstall Previous RAdmin Server Clients and Install RAdmin 3.3

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''' Automated RAdmin Update Script to install RAdmin 3.3 Server

''' The script uninstalls all previous RAdmin Versions start at v2.

''' Written by Andrew Nova for HUB International, December 2008

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''



On Error Resume Next

strComputer = "."

Const HKEY_LOCAL_MACHINE = &H80000002

Const HKLM = &H80000002

Const OverwriteExisting = True

Const DeleteReadOnly = True



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''



KeyExists = "0"

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

MyFileServer = "\\YourFileServer\YourFolder\YourSUBfolder\"



Set objNetwork = CreateObject("Wscript.Network") 'get the current computer name

objComputerName = objNetwork.ComputerName



''' Get Windows Default Directory

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")



For Each objItem In colItems

WinDir = objItem.WindowsDirectory

Next



''' Create Software Folder if it doesnt exist

Set objFSO = CreateObject("Scripting.FileSystemObject")

If Not objFSO.FolderExists("C:\RAdmin.Software") Then

Set objFolder = objFSO.CreateFolder("C:\RAdmin.Software")

End If





''' Create the version Array

Dim MyRVersion(6)

MyRVersion(0) = "Remote Administrator v2.0"

MyRVersion(1) = "Remote Administrator v2.1"

MyRVersion(2) = "Remote Administrator v2.2"

MyRVersion(3) = "Radmin Server 3.0"

MyRVersion(4) = "Radmin Server 3.1"

MyRVersion(5) = "Radmin Server 3.2"

MyRVersion(6) = "Radmin Server 3.3"



''' Loop through the Array to see what versions are installed.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

For x = 0 To 6



Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & "root\default:StdRegProv")

objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys



For Each subkey In arrSubKeys

objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "DisplayName", DisplayName



If DisplayName = MyRVersion(x) Then

objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, "UninstallString", UninstallString



If DisplayName = "Radmin Server 3.3" Then

WScript.quit

End If



RAdminVersion = Left(DisplayName,20)



If RAdminVersion = "Remote Administrator" Then



Uninstallme = WinDir & "\system32\r_server.exe /uninstall /silence"

DelSFile = WinDir & "\system32\r_server.exe"

DelDLL = WinDir & "\system32\raddrv.dll"

MyRAFolder = "C:\Documents and Settings\All Users\Start Menu\Programs\" & DisplayName

RAFolder = "C:\Documents and Settings\All Users\Start Menu\Programs"



Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.DeleteFile(MyRAFolder & "\*"), DeleteReadOnly



Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.DeleteFolder(RAFolder & "\Remote Administrator*")



Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & DisplayName

objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath



Set objShell = CreateObject("WScript.Shell")

objShell.Run Uninstallme, ,True

Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.DeleteFile DelSFile,True

objFSO.DeleteFile DelDLL,True



Else



MyNewString = Replace(Uninstallstring,"MsiExec.exe /X","")

MyUnInstall = "MsiExec.exe /norestart /q/x" & MyNewString & " /L*V " & "C:\RAdmin.Software\RAdmin.Uninstall.log"



Set objShell = CreateObject("WScript.Shell")

objShell.Run MyUnInstall, ,True



End If

End If

Next

Next





''' Copy MSI file to the C drive.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.CopyFile MyFileServer & "RAdmin.3.3.Install.msi" , "C:\RAdmin.Software\", OverwriteExisting





''' Set the MSI Install Command and install package

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

RScommand = "C:\RAdmin.software\RAdmin.3.3.Install.msi" & " REBOOT=ReallySuppress /Quiet" & " /L*V " & _

"C:\RAdmin.Software\RAdmin.3.3.Install.log"



Set WshShell = WScript.CreateObject("WScript.Shell")

Set objShell = CreateObject("WScript.Shell")

objShell.Run RScommand, ,True



WScript.quit
Profile
Pages: 1

Users browsing this topic
Number of guests: 1, registered members: 0, in total hidden: 0

Radmin 3.5

Windows 8 Compatible

DOWNLOAD

Free for 30 days

BUY NOW

Only $49 per lifetime license
for  50 PCs - $29.8 per remote PC
for 100 PCs - $24.9 per remote PC
for 150 PCs - $23.3 per remote PC
from 200 PCs - $22 per remote PC
Follow us on Twitter
Famatech Corporation Copyright © 1999-2014 Famatech. All rights reserved.