OLD - Deploying Solus via powershell script
Due to strange issues pushing out the Solus agent from the Solus server, I have decided to take a leaf out of @Boredguy's book and not bother pushing out from the server console... but instead deploy it with a script which records the GUID in a CSV file for easy reinstallation.
Notes:
The following is setup for a 64 Bit Windows OSes, but can be modified to work with 32 Bit by adding a few lines of code and the installer. If you can not find a copy of the Solus agent on your server, you can go into Solus Deployment Service, click Settings, SOLUS3, SOLUS, Export agent installer.
Let's get started...
In a new folder on your software deployment server share, create a folder called Solus and copy the following items:
Solus3.Keys.DeploymentService.Public.xml (From the Solus Server)
SOLUS3AgentInstaller_x64.msi (From the Solus Server)
Agents.csv (new blank file, needs user write permissions to this file only)
SolusInstaller.ps1 (i.e. coding below).
Coding note:
1) Replace \\DEPLOYMENT-SERVER-HERE\SHARE-HERE$ with your Deployment share that holds the Solus folder you created.
2) Replace SOLUS-SERVER-HERE with your Solus Server Name.
PowerShell code for SolusInstaller.ps1:
$Found=$false
$CSV = "\\DEPLOYMENT-SERVER-HERE\SHARE-HERE$\Solus\Agents.csv"
$SolusAgentDataList=IMPORT-CSV $CSV -Header ("ID","Name")
$GUID=[system.GUID]::NewGuid().ToString()
$ComputerName = (Get-Childitem env:computername).Value
ForEach ($SolusAgentDataItem in $SolusAgentDataList)
{
If ($SolusAgentDataItem.Name -eq $ComputerName)
{
$Found=$true
$GUID=$SolusAgentDataItem.ID
}
}
If (!$Found)
{
Add-Content $CSV "$GUID,$ComputerName`n"
}
&msiexec.exe /i `"\\DEPLOYMENT-SERVER-HERE\SHARE-HERE$\Solus\SOLUS3AgentInstaller_x64.msi`" AGENTSERVICEADDRESS=`"net.tcp://localhost:52966`" AGENTID=$GUID DEPLOYMENTSERVERADDRESS=`"net.tcp://SOLUS-SERVER-HERE:52965`" RSAKEYPATH=`"\\DEPLOYMENT-SERVER-HERE\SHARE-HERE$\Solus`" /qn /l*v C:\solus.log
Start-Sleep -s 5
To ensure you reuse the same GUID, and get your SIMS/FMS/Discover automatically reinstalled when you rebuild your PC, you can get existing Solus agent GUIDs by looking at AGENTID located in HKEY_LOCAL_MACHINE\SOFTWARE\CCS\SOLUS3\Agent and adding manually to the CSV file in the format.
01234567-89ab-cdef-0123-456789abcdef,Computer-Name-Here
with a new line at the end.
When the script is run on any machine with a computer name that hasn't been recorded in the CSV file, as long as you have given the Installer write permissions to the CSV file, a new GUID and the computer name will be added into the CSV file. You can then go on Solus and assigned SIMS/FMS/Discover to the Agent.
When the script is run on any machine with a computer name that IS recorded in the CSV file, the GUID is picked up from the CSV file and Solus will install with the software you had previously specified.
Edited by DJ-1701

1 Comment
Recommended Comments
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 accountSign in
Already have an account? Sign in here.
Sign In Now