Jump to content

Recommended Posts

Posted (edited)

Hi,

 

Trying to replicate what is done to the database when an agent is 'Uninstalled'

 

I regularly re-image our machines which works fine for all software other than SOLUS3. As far as I can tell, its because a new GUID is generated and doesnt match the one in the database for the hostname, therefore fails signature checks etc...

 

To remedy this, I uninstall the agent through SOLUS3 DS and then run our in-house install script (re-install doesnt work for some reason). The trouble is, if im re-imaging 100+ machines, I have to boot them all, uninstall through SOLUS3 DS then shutdown and manually walk around to trigger the deployments as 'remove computer' removes the client from the targets screen and agents screen. Whereas the uninstall keeps it in the targets but removes it in the agents section , which allows it to be picked back up and detects the updates.

 

Looking at the database, the computer's record is deleted from the solus3.agent table in the database. It it just a case of removing the appropriate record from this table?

 

Hoping someone will have an idea of how I can overcome this without doing it manually for each machine.

 

Thanks

Edited by rrafluap
Posted
Don't include the S3 agent in the image, have it install on startup. Pretty sure one of the Capita devs said if you don't set the GUID it'll get pushed from the server nowadays.
  • Thanks 1
Posted

I don't include SOLUS or SIMS on the image as they change so much, they are scripted during the deployment process.

 

Ah, hopefully it's that simple! I'll have a go on a test machine tomorrow and report back!

 

If it does work...Do you know if it's a machine in the target list but not in the agents list as yet (not installed yet) and I deploy without the GUID, does one get generated for it and sync up?

 

Thanks

Posted
I don't include SOLUS or SIMS on the image as they change so much, they are scripted during the deployment process.

 

Ah, hopefully it's that simple! I'll have a go on a test machine tomorrow and report back!

 

If it does work...Do you know if it's a machine in the target list but not in the agents list as yet (not installed yet) and I deploy without the GUID, does one get generated for it and sync up?

 

Thanks

 

How would one script it during the deployment process I thought you where supposed to push it out.

Posted
If it does work...Do you know if it's a machine in the target list but not in the agents list as yet (not installed yet) and I deploy without the GUID, does one get generated for it and sync up?

 

You'd have to have it previously defined as a sims workstation, ie you add desktop01 in S3 deploy SIMS, then reinstall it, add the S3 agent - you can't just created desktop02 and get it to assume you want sims on it. Other caveat would be if you've got duplicates in the database - Capita should be able to help clear it out - although if its really horrid it might be easier\quicker\better to just start again, but they'll be able to suggest whats best, after all its what you pay support for ;)

Posted

I use 3 scripts, one to install SIMS+FMS, another to install SOLUS3 and another to check for SOLUS updates (I had trouble with getting SOLUS 3.12.1.2 to deploy and had to do it manually / startup script)

 

The scripts are:

SIMS.vbs:

strFolder = Replace(WScript.ScriptFullName,WScript.ScriptName,"")

Set WSHShell = CreateObject("WScript.Shell") 
Set WSHNetwork = WScript.CreateObject("WScript.Network")

strComputerName = WSHNetwork.ComputerName
strFMSComputers = "ADMIN-RG, ADMIN-CS, TECH-PF, SLAPTON"

WSHShell.run "xcopy """ & strFolder & "SIMS.ini"" ""C:\Windows"" /y", 1, True
WSHShell.run strFolder & "SIMS\SIMSInfrastructureSetup.exe /S {QuietMode} {SIMSWorkstation}", 1, True
WSHShell.run strFolder & "SIMS\SIMSManualSetup.exe /S {QuietMode} [sIMSDirectory]=""Z:"" [sIMSDotNetDirectory]=""C:\Program Files\SIMS\SIMS .net""", 1, True
WSHShell.run strFolder & "SIMS\SIMSAMPARKSetup.exe /S {QuietMode} [sIMSDirectory]=""Z:"" [sIMSDotNetDirectory]=""C:\Program Files\SIMS\SIMS .net""", 1, True
WSHShell.run strFolder & "SIMS\SIMSApplicationSetup.exe /S {QuietMode} [sIMSDirectory]=""Z:"" [sIMSDotNetDirectory]=""C:\Program Files\SIMS\SIMS .net""", 1, True
WSHShell.run "xcopy """ & strFolder & "connect.ini"" ""C:\Program Files\SIMS\Sims .net"" /y", 1, True
WSHShell.run "xcopy """ & strFolder & "SIMS .net.lnk"" ""C:\Users\Public\Desktop"" /y", 1, True

If InStr(strFMSComputers, strComputerName)  Then 'Computers requiring FMS need infrastructure components
WSHShell.run strFolder & "SIMS\SIMSInfrastructureSetup.exe /S {QuietMode} {FMSWorkstation}", 1, True
WSHShell.run strFolder & "SIMS\FMS\FMSApplicationSetup.exe /S {QuietMode} [sIMSDotNetDirectory]=""C:\Program Files\SIMS\SIMS .net""", 1, True
WSHShell.run "xcopy """ & strFolder & "FMSConnect.ini"" ""C:\Program Files\SIMS\FMSSQL"" /y", 1, True
WSHShell.run "xcopy """ & strFolder & "FMS.lnk"" ""C:\Users\Public\Desktop"" /y", 1, True		
End If

WScript.quit()

 

This checks the computer name, if its name is one of those listed near the top, it installs SIMS then FMS, if not in the list, just SIMS. It copys over some shortcut files too. And a SIMS.ini template for the installs to add to.

 

SOLUS.vbs is:

 

strFolder = Replace(WScript.ScriptFullName,WScript.ScriptName,"")

Set WSHShell = CreateObject("WScript.Shell") 
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set WSHFSO = CreateObject("Scripting.FileSystemObject")

strTempDir = WSHShell.ExpandEnvironmentStrings("%temp%")
strInstallTemp = strTempDir & "\SOLUS3Temp"

strCompName = WSHNetwork.ComputerName
strLogDir = "\\SERVER\public\Troubleshooting\SOLUS3"

Set TypeLib = CreateObject("Scriptlet.TypeLib")
strGUID = TypeLib.Guid
strGUID = Left(strGUID, 38)

If NOT WSHFSO.FolderExists(strInstallTemp) Then
WSHFSO.CreateFolder(strInstallTemp)
End If

WSHFSO.CopyFolder strFolder & "\SOLUS3", strInstallTemp, True 

WSHShell.Run "taskkill /f /im Sims.Solus3.Agent.UI.exe", 0, True
WSHShell.Run "net stop Solus3Agent", 0, True

WSHShell.Run "msiexec.exe /lv* """ & strLogDir & "\" & strCompName & "_SOLUS3_Installer.log"" /i """ & strInstallTemp & "\SOLUS3AgentInstaller_x86.msi"" AGENTSERVICEADDRESS=""net.tcp://localhost:52966"" AGENTID=""" & strGUID & """ DEPLOYMENTSERVERADDRESS=""net.tcp://SOLUSSERVER:52965"" RSAKEYPATH=""" & strInstallTemp & """ MSIRESTARTMANAGERCONTROL=0 /norestart /qb!", 1, True

WSHShell.Run "net start Solus3Agent", 0, True

WSHFSO.DeleteFolder(strInstallTemp)

WScript.Quit

 

What SOLUS.vbs does is, copies the install files to the temp dir, kills any SOLUS programs running - Ive had issues with the msiexec.exe installs not stopping solus or wanting a restart making it non silent / required user interaction. So to remedy this, I just kill it.

 

As some of the file references are in different places, ive included the file structure as an image just incase. Also, its not perfect but definitely does the job!

 

The SOLUS3.vbs script will likely change though as @matt40k suggested, Im going to try omitting the GUID part.

 

Hope this is useful to others!

SIMS Deployment Dir.png

  • Thanks 2
Posted
Surely the SIMS.vbs is redundant as SOLUS3 does that?

I don't think I've ever had SOLUS perform an initial install. It just sits with no software. Once it's on, it keeps it up to date though

Posted
If you've just installed the s3 agent manually (ie scripted, not from the ui), it won't know it needs SIMS, just a question of adding it as a SIMS machine in S3.
Posted
Ah ok! I need to test out lots of these scenarios and see how it works. Only been hosting SIMS locally for about 6 months so not had time to try everything yet
Posted (edited)

Since the SOLUS 3.12 upgrade, you can now specify what you want SOLUS3 to install in the javascript file Capita provide with SOLUS3 for when you are doing manual installs, it could easily be adapted to work in a script.

var wshShell, wshSysEnv;var fso, f1, typeLib;fso = new ActiveXObject("Scripting.FileSystemObject");typeLib = new ActiveXObject("Scriptlet.TypeLib");wshShell = WScript.CreateObject("WScript.Shell");var logFileName = WScript.Arguments(0);var agentAddress = WScript.Arguments(1);var dsAddress = WScript.Arguments(2);var keyFileName = WScript.Arguments(3);var msi32 = WScript.Arguments(4);var msi64 = WScript.Arguments(5);var msi = "";if (is64())    msi = msi64;else    msi = msi32;    wshShell.Run("msiexec.exe /lv* \"" + fso.BuildPath(wshShell.Environment("SYSTEM")("TEMP"), logFileName) +              "\" /i \"" + wshShell.CurrentDirectory + "\\" + msi +              "\" AGENTSERVICEADDRESS=\"" + agentAddress +              "\" AGENTID=\"" + typeLib.Guid.toString().substring(0, 38) +              "\" DEPLOYMENTSERVERADDRESS=\"" + dsAddress +              "\" RSAKEYPATH=\"" + wshShell.CurrentDirectory +[color=#008000]              //"\" PREDEFINEDAGENTTARGETS=\"Sims Fms Discover" +[/color]              "\"", 0, true);function is64() {    var shell = WScript.CreateObject("WScript.Shell");    return (wshShell.Environment("SYSTEM")("PROCESSOR_ARCHITECTURE").indexOf("64") + 1);}

Edit: Can anyone tell me why, when I paste code into this forum it loses all the new lines?

Edited by Esteban_Child_of_the_Sun
  • Thanks 1
Posted
Since the SOLUS 3.12 upgrade, you can now specify what you want SOLUS3 to install in the javascript file Capita provide with SOLUS3 for when you are doing manual installs, it could easily be adapted to work in a script.

var wshShell, wshSysEnv;var fso, f1, typeLib;fso = new ActiveXObject("Scripting.FileSystemObject");typeLib = new ActiveXObject("Scriptlet.TypeLib");wshShell = WScript.CreateObject("WScript.Shell");var logFileName = WScript.Arguments(0);var agentAddress = WScript.Arguments(1);var dsAddress = WScript.Arguments(2);var keyFileName = WScript.Arguments(3);var msi32 = WScript.Arguments(4);var msi64 = WScript.Arguments(5);var msi = "";if (is64())    msi = msi64;else    msi = msi32;    wshShell.Run("msiexec.exe /lv* \"" + fso.BuildPath(wshShell.Environment("SYSTEM")("TEMP"), logFileName) +              "\" /i \"" + wshShell.CurrentDirectory + "\\" + msi +              "\" AGENTSERVICEADDRESS=\"" + agentAddress +              "\" AGENTID=\"" + typeLib.Guid.toString().substring(0, 38) +              "\" DEPLOYMENTSERVERADDRESS=\"" + dsAddress +              "\" RSAKEYPATH=\"" + wshShell.CurrentDirectory +[color=#008000]              //"\" PREDEFINEDAGENTTARGETS=\"Sims Fms Discover" +[/color]              "\"", 0, true);function is64() {    var shell = WScript.CreateObject("WScript.Shell");    return (wshShell.Environment("SYSTEM")("PROCESSOR_ARCHITECTURE").indexOf("64") + 1);}

Edit: Can anyone tell me why, when I paste code into this forum it loses all the new lines?

 

I used the old one to create the script i use at the moment. Didnt realise they added that.

Posted

@rrafluap / @Esteban_Child_of_the_Sun:

 

From my experience, I've found two things a) the helpdesk won't support custom scripts being used for deploying solus 3 if you then log issues with solus 3

b) the behaviour in solus 3.12 for the predefined target / manual installs doesn't work properly if you reinstall a workstation

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...