Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to uninstall Symantec Endpoint 11.x and install Sophos

Status
Not open for further replies.

mragain

IS-IT--Management
Oct 10, 2002
32
US
dim fso,fs1,subss

Set ws = WScript.CreateObject ("WScript.Shell")
set fso = CreateObject("Scripting.FileSystemObject")

if fso.FolderExists("C:\Documents and Settings\All Users\Application Data\Symantec\Cached Installs") Then
set fs1 = fso.GetFolder("C:\Documents and Settings\All Users\Application Data\Symantec\Cached Installs")
set subss = fs1.SubFolders
End if


If fso.FileExists("c:\program files\symantec\symevent.sys") Then
for each objSubFolder In subss
ws.Run "msiexec.exe /x " & objSubfolder.Name & " /q /norestart",1,True
Next
Else
if fso.FileExists("c:\program files\symantec\liveupdate\lsetup.exe") Then
ws.Run "c:\progra~1\symantec\Liveupdate\lsetup.exe /U /q",q,True
else
End if
End if

Set net0 = wscript.CreateObject ("WScript.Network")

struser = "EMLibUser1" 'Update Server username
strPass = "mysecurepassword" 'Update Server password for given username
driveletter = "r:" 'Drive letter to use when mapping to server for sophos install

if fso.DriveExists(driveletter) then
net0.RemoveNetworkDrive driveletter
End if

net0.MapNetworkDrive driveletter,"\\sophos.server.com\Interchk",false,struser,strPass

ws.Run driveletter & "\esxp\setup.exe -user " & struser & " -pwd " & strPass & " -mng yes -updp \\sophos.server.com\Interchk\ESXP",1,True

net0.RemoveNetworkDrive driveletter

set net0 = Nothing
Set ws = Nothing
Set fso = Nothing
Set fs1 = Nothing

 
hope you dont mind me casting an eye...

you have no logging in your script? so, when asked my management how many failed the uninstall or uninstalled but didnt install etc etc you wont be able to answer them (perhaps you think the back end products will give you this but i doubt you can rely on them) i would add hordes of audit information, how long the uninstall took, the return codes from all your threads etc etc to %machinename%.txt file, have this file created locally then copied to a central share at the end of your script. put in some nice key words that you can then search for and pull together your audit information to give status updates.

i woudl avoid the use of "c:\program files..." and "c:\documetns an settings etc etc and instead make use of the seemingly under-utilised WshShell.ExpandEnvironmentStrings

a security product install which has a username and password in it :) only teasing. is it not possible to move the installation binaries to a share which users can have read and execute on and doesnt contain any other sensitive information?
 
actually, i wouldnt suggest putting the uninstall of one product and the install of another one into the same thread is a good idea in its own right. its nice to keep these things seperated and the name and version of the software in question is not a bad way to go, so i am suggesting something more along the lines of a folder structure

+ Symantec_EndPoint_V11_EN\_CUSTOM\product_uninstall.vbs
+ Sophos_SuperDuper_V2.0_EN\_CUSTOM\product_install.vbs

your install service (whatever that might be, ADS, TIVOLI, a batch file etc) can then call each one individually.

ok, the end result if the same but by splitting things by 'one thread to do one job' it means your 'intelligent' layer can choose which ones of all this finite elements can be run,,,,makes things a lot more re-usable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top