Automating the Configuration Wizard

In a previous post I said how to run multiple Orion installations without running the Configuration Wizard.  This is great if you have a new big installation planned.  So the last step is to actually run the configuration wizard.

The information below draws heavily from a document outlining the previous post and this step.

The first step requires us to write an XML file.  I’ve taken that one and added some comments, so you can use mine or the original one.  I have no skin in the game.

<?xml version="1.0" encoding="utf-8"?>
<SilentConfig>
    <Host>
        <Info>
            <!-- Reconfigure tasks...
                 Yes - we should do all of these
            -->
            <ReconfigureDatabase>True</ReconfigureDatabase>
            <ReconfigureWebsite>True</ReconfigureWebsite>
            <ReconfigureServices>True</ReconfigureServices>
            <ReconfigurePermissions>True</ReconfigurePermissions>
            <!-- Database Settings
            -->
            <Database>
                <CreateNewDatabase>True</CreateNewDatabase>
                <!-- True for SQL authenticaiton to DB. Needs a sysadmin user.
                     False for Windows authenticaiton -->
                <UseSQLSecurity>False</UseSQLSecurity>
                <!-- Database name to use when creating -->
                <!-- Database name that will be created.
                     Default "SolarWindsOrion"
                -->
                <DatabaseName>SolarWindsOrion</DatabaseName>
                <!-- If undefined, then we'll use the SQL Default Path
                     This is only really applicable if we're using a local database
                -->
                <DatabasePath />
                <!-- SQL Server, Instance, and Port (if necessary)
                     Syntax:
                        Server with Default Instance: ServerName (or Server.domain.fqdn)
                        Server with Instance: ServerName\InstanceName,TcpPort
                -->
                <ServerName>MySqlServer.Domain.Local</ServerName>
                <!-- SQL Server Instance name - normally null -->
                <InstanceName />
                <!-- "User" and "UserPassword" are for Database Creation
                     ===================================================
                     User name to access DB - aka the "Orion Account"
                     For SQL authentication sa.
                     For Windows authenticaiton Administrator
                -->
                <User>Administrator</User>
                <UserPassword>password</UserPassword>
                <!-- If UseExistingSqlAccount is False,
                     then we need to define the "Account" and "AccountPassword"
                -->
                <UseExistingSqlAccount>False</UseExistingSqlAccount>
                <!-- Database user that will be created.
                     Default "SolarWindsOrionDatabaseUser"
                -->
                <!-- "Account" & "AccountPassword" are for database access by the Orion software
                     ===================================================
                     Account default name is "SolarWindsOrionDatabaseUser"
                 -->
                <Account>SolarWindsOrionDatabaseUser</Account>
                <AccountPassword>NotVeryComplexPassword</AccountPassword>
                <NeedSQLServerSecurity>False</NeedSQLServerSecurity>
                <NeedToChangeSAPassword>False</NeedToChangeSAPassword>
                <SAPassword />
                <AddServiceDependencies>False</AddServiceDependencies>
                <RemoveServiceDependencies>False</RemoveServiceDependencies>
                <FailureInfo />
            </Database>
            <Website>
                <!-- Folder: Where to create the website -->
                <Folder>C:\InetPub\SolarWinds</Folder>
                <!-- Address: What IP's should be used for hosting -->
                <Address>(All Unassigned)</Address>
                <!-- Port: What TCP Port should be used for the website -->
                <Port>80</Port>
                <!-- ApplicationName: What do we want to call it (Default: SolarWinds NetPerfMon) -->
                <ApplicationName>SolarWinds NetPerfMon</ApplicationName>
                <!-- LaunchWebConsole: Do we want to launch the web console after running? -->
                <LaunchWebConsole>False</LaunchWebConsole>
                <!-- ConfigurationSkipped_IISNotInstalled: Do we want to skip the config portion for IIS being checked? -->
                <ConfigurationSkipped_IISNotInstalled>False</ConfigurationSkipped_IISNotInstalled>
                <!-- EnableWindowsLogin: Do we want to enable Windows Integrated Authentication (WIA) on the website? -->
                <EnableWindowsLogin>False</EnableWindowsLogin>
            </Website>
        </Info>
    </Host>
    <Plugins>
        <!-- <Plugin Assembly="" AssemblyFile="" FactoryType=""  /> -->
    </Plugins>
</SilentConfig>

So now I have what I call a “Blank” Silent Config file.  It has entries, but most of them are nonsensical or generic.  I need to specialize this for my installation.  You can do this by copying and editing the file, but I prefer PowerShell (don’t I always?).

$SqlServer = "MyServerName.FQDN.Local"
$SqlUsername = "sa" # or another user with sysadmin rights
$SqlPassword = "MySaPassword" # accompanying password
$DatabaseName = "PorkChopExpress" # the name for the database


$OrionUsername = "SolarWindsOrionDatabaseUser" # this is the default, so I just leave it
$OrionPassword = "MyComplexSolarWindsDatabasePassword" # the accompanying password

$ConfigXml = New-Object -TypeName System.Xml.XmlDocument
# Load the "Blank" XML into the ConfigXML Object
$ConfigXml.Load("\\demo.lab\files\Scripts\SolarWinds\Builds\BlankSilentConfig.xml")
# Change some of the settings
# Remember that "True" or "False" here are strings and not $true or $false
$ConfigXml.SilentConfig.Host.Info.Database.CreateNewDatabase     = "True"
$ConfigXml.SilentConfig.Host.Info.Database.UseSQLSecurity        = "True"
$ConfigXml.SilentConfig.Host.Info.Database.ServerName            = $SqlServer
$ConfigXml.SilentConfig.Host.Info.Database.DatabaseName          = $DatabaseName
$ConfigXml.SilentConfig.Host.Info.Database.User                  = $SqlUsername
$ConfigXml.SilentConfig.Host.Info.Database.UserPassword          = $SqlPassword
$ConfigXml.SilentConfig.Host.Info.Database.UseExistingSqlAccount = "True"
$ConfigXml.SilentConfig.Host.Info.Database.Account               = $OrionUsername
$ConfigXml.SilentConfig.Host.Info.Database.AccountPassword       = $OrionPassword
$ConfigXml.SilentConfig.Host.Info.Website.ApplicationName        = $DatabaseName

# Save my config file
$ConfigXml.Save("D:\Download\SilentConfig.xml")

Truthfully, I only need a few things here:

  • Database Server (IP, Host, or FQDN)
  • Database user (and password) with sysadmin rights – here I’m using “sa” because I can
  • Database name for Orion – I’m using PorkChopExpress because of this post I read.
  • The Orion SQL Username (and password) – this will be created if it doesn’t exist.

Please note that anything that isn’t expressly overwritten by the $ConfigXML lines is kept as default from the “Blank” template.

So now I’ve got the Config file saved with content that I want.  All that’s left is to run the executable.  Yes, I’m also doing this in PowerShell… #BecauseICan.

# Find the executable - this is useful if you didn't install Orion on the C: Drive
$InstallPath = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\SolarWinds\Orion\Core" -Name InstallPath | Select-Object -ExpandProperty InstallPath
$ConfigWizardExe = Join-Path -Path $InstallPath -ChildPath "ConfigurationWizard.exe"
Write-Host "Executing Configuration Wizard" -ForegroundColor Green
# Create a new stopwatch, then start it
$Sw = New-Object -TypeName System.Diagnostics.Stopwatch
$Sw.Start()
# Create the argument list (we need the -silent and the -cfg flags)
$ArgumentList = @()
$ArgumentList += "-silent"
$ArgumentList += "-cfg:`"SilentConfig.xml`""
# Run the configuration wizard with the arguments.
# Important note here is the "WorkingDirectory"
# - I'm doing this so that I don't have to worry about the full path to the XML file
Start-Process -FilePath $ConfigWizardExe -WorkingDirectory "D:\Download" -ArgumentList $ArgumentList
# Check to see if it's still running... if not, then tell me how long it ran.
While ( Get-Process -Name "ConfigurationWizard" -ErrorAction SilentlyContinue )
{
    Start-Sleep -Seconds 1
}
$Sw.Stop()
Write-Host "Completed in $( $Sw.Elapsed.TotalSeconds ) seconds" -ForegroundColor Yellow

Did it work?  Two quick ways to test.

Open a browser.

Success!

Did a new database get created?

Success!

2 thoughts on “Automating the Configuration Wizard”

  1. Hi Kevin,

    Appreciate you creating this doc. It is really helpful.
    Have you tried the silent install on versions higher than HCO 2022.2?

    Thanks
    Archita

    Reply
    • I haven’t tried in a little bit now, but it’s as good a time as any to try this again. Considering the Hybrid Cloud Observability installation is available in both Azure and AWS, I’m sure there’s a way to do the work. Might even take the same syntax – but I haven’t tested.

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.