Loading

Scripted remote SMACC install

 

Hi,

There's an article by  here about installing the SMACC on remote computers.  It's very useful, but it's quite a tedious manual process which needs to be repeated each time there are updates.  So I decided to write a powershell script which does it automatically.  When Snow updates, all I need to do is run the script again.  I thought that I'd share it in case anybody wants to do the same.

Note: I have not tested this *exact* version of the script, because our servers don't all have the Snow software installed on the C:\ drives.  This version below assumes that everything is installed on C:\, which I think is the default. You'll need to enter your server names where shown at the start of the script.

Warning: the usual disclaimers apply! Don't blame me if the script does anything wrong.  Please check through the code before you try it on your environment.

But please let me know if it's useful (and if it works for you).  I've pasted the script below...

Regards, David

<#

 

  Remote SMACC install/update for Snow

 

  Author: David Hobbs

 

  Updated: 2019-06-07

 

#>

# NOTE: Enter your server names below:

 

#

 

$invServer = "YOUR_INVENTORY_SERVER_NAME";

 

$slmServer = "YOUR_SLM_SERVER_NAME";

 

#

 

# END NOTE

Function Copy-WithProgress

 

{

 

  [CmdletBinding()]

 

  Param(

 

    [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $Source,

 

    [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=1)] $Destination,

 

    [Parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true, Position=2)] $Clean = $true

 

  )

 

  $Filelist = Get-Childitem "$Source" –Recurse;

 

  $Total = $Filelist.Count;

 

  $Position = 0;

 

  $Source = $Source.ToLower();

  if (!(test-path $Destination)) {

 

    New-Item -ItemType Directory -Force -Path $Destination;

 

  } elseif ($Clean) {

 

    # (optionally) remove any old files before copying the new ones

 

    Remove-Item "$Destination\*" -Recurse -Force;

 

  }

 

 

  foreach ($File in $Filelist) {

 

    $FileOnly = Split-Path $File.Fullname -Leaf;

 

    $PathOnly = (Split-Path -Path $File.Fullname).ToLower();

 

    $FileLowerPath = Join-Path -Path "$PathOnly" -ChildPath "$FileOnly";

    If ($FileLowerPath.StartsWith($Source)) {

 

      $Filename = $FileLowerPath.Remove(0, $Source.Length);

 

    }

    $DestinationFile = Join-Path -Path "$Destination" -ChildPath "$Filename";

 

    Write-Progress -Activity "Copying data from '$Source' to '$Destination'" -Status "Copying File $Filename" -PercentComplete (($Position / $total) * 100);

    Copy-Item $File.FullName -Destination $DestinationFile -Force;

 

    $Position++;

 

  }

 

}

function Copy-FromInv($path, $invServerDrive, $clean = $true) {

 

  $remote = "\\$invServer\$invServerDrive$\$path";

 

  $local = "C:\$path";

 

  Copy-WithProgress -Source $remote -Destination $local -Clean $clean;

 

}

function Copy-FromSlm($path, $slmServerDrive, $clean = $true) {

 

  $remote = "\\$slmServer\$slmServerDrive$\$path";

 

  $local = "C:\$path";

 

  Copy-WithProgress -Source $remote -Destination $local -Clean $clean;

 

}

# step 1

 

Copy-FromInv "Program Files\Snow Software\Snow Management and Configuration Center" "C";

# step 2

 

Copy-FromInv "Program Files\Snow Software\Snow Inventory\InventorySMACCPlugin" "C";

# step 3

 

Copy-FromSlm "Program Files\Snow Software\Snow License Manager\Tools\SmaccPlugin" "C";

# step 4

 

Copy-FromInv "ProgramData\SnowSoftware\SnowMACC\RegisteredPlugins" "C";

 

Copy-FromSlm "ProgramData\SnowSoftware\SnowMACC\RegisteredPlugins" "C" $false; # don't clean the directory this time

# step 5 - TEST IT :-)

 

# You can try to run "C:\Program Files\Snow Software\Snow Management and Configuration Center\SnowMACC.exe"

  • Great work! This will be extremely useful! 
  • >it would be even better if the installer could somehow determine which versions are needed and provide   That will not be possible, as this would need to query the database for the version strings and the MSI does not know the credentials. So you may have to add some scripting before (e.g.: SQLCMD) to get this, then selecting the right versions to install by MSI, then doing a silent MISI install by passing the versions (:= FearturNames) on the commandline.
    • Thanks.  In which case, I will probably continue using my script posted above, because it keeps my remote SMACC exactly in line with the version on our servers.  From that perspective it is very convenient.  But please keep up your great work, I look forward to hearing how you get on. David
  • Because the VirtSMACC approach (see above) worked so well for me, I currently stalled the SMACC-MSI project.   If there will be massive demand, I will re-think on reviving it, but would stick with the 'one MSI per SMACC-Version' approach then. The 'one-big-MSI for all versions and pick one to install' approach would need extra logic to handle exclusice selecting (and possibly updating) only ONE Version out of the multiple, included versions. Thus complicating creation, maintenance and QS.   Another drawback is, that such a 'beast' would be a MSI in size of about 900+MB ... :-(     If you still are in desperate need of SMACC MSIs - despite the availability of the VirtSMACC - please let me know.
  • Hi all,   as I am working on automating Snow-Install(s) (totally scripted/unattended) and need to have several environments of different versions for support as well as managing production, reference, staging and test environments for QA and process reasons. Thus I was in constant need of (re-)installing some combinations of SMACC versions to my admin workstation to match the different installs.  That is currently done by a  scripting solution that i built up, but I am now preparing MSI installers to accomplish the task(s) and to be able to hand this over to and to conform with 'normal' deployment processes in the company.   My question to the community out there is:   a) would you prefer a larger number of (smaller) MSIs which will install/update only one SMACC-Version.   That is:   a) SMACC-IS in version: 5.4.0, 5.4.01, 5.4.02, 6.0.00, 6.0.05   b) SMACC-LM in version(s): 8.3.00, 8.3.01 through 8.3.07, 9.0.00, 9.0.01, 9.1.00, 9.2.00, 9.2.01, 9.2.02 thus totaling in 20 MSIs ?! or b) would you prefer ONE MSI having all those Versions (IS and LM) as selectable 'Features' and use that (big) one MSI to install and giving intended combination of SMACC-IS and/or SMACC-LM as a 'feature-selection' during (possibly unattended) setup? Your feedback will allow me to craft the MSI(s) to your real needs rather than opting for the 'wrong' approach. BTW: I am currently experimenting with a solution to allow to have the SMACC-versions to run as 'standalone' virtualized apps (without need for separate app-virtualization infrastructure) then possibly allowing to run different versions of SMACC side by side on same Admim-Workstation without need for installing/uninstalling/reinstalling separate versions (stay tuned, will let you know the outcome ....).
    Expand Post
    • Hi ‌, that sounds like excellent work.  What I need to do is perform a remote SMACC install that matches the versions of Snow Inventory and License Manager installed in my environment.  So if I had to choose from your options it would be the "one big msi" approach with selectable features, I think. But it would be even better if the installer could somehow determine which versions are needed and provide the appropriate choices based on what we have on our servers, I don't know how difficult that would be, it might not be possible. I especially like the idea of the standalone virtualized SMACCs where we could have different versions side-by-side that would be really useful for working with different environments off the same box. Thanks for you help!  David
      Expand Post
  • OK - just some hours after release of IS 6.0.07 and SMACC of matching version here it is - VirtSMACC-IS in Version 6.0.07 !   The original Answer in this tread was edited as well to now offer VirtSMACC v6.0.07 as download. Remeber: donwload link may be PW protected. If so, use as PW:  apogiz SMACC_IS v6.0.07_splash.exe   (should work with older IS Versions/Installs as well)   https://send.firefox.com/download/3cc0c0634c787348/#YdGfmcjjxqrBM_RZhMYIWg       SHA256: EA1762C2E6A351C691F6E7F0667C3EB843EA9FC90F29425D75A7DB6327945017
10 of 13

Loading
Feed Detail