Version 4

    UPDATE: Updated to 1.0.1 to fix exports of User Graphics Files


    Because I'm constantly creating and destroying Orion instances in my currently capacity, I sometimes forget to export everything before I start working on the next instance.  To that end, I started playing around with the Orion SDK and seeing if there was a way that I could rapidly export some content.  The first thing time that I had this was when I stood up a new server and wanted to use my existing Network Path Troubleshooting map.  I started to dig around a little bit and what to my wondering eyes should appear?  No, not reindeer, but a 'table' called MapStudioFiles.


    Then I broke out my PoSH hat and started tinkering.  This is what I came up with:



    File Name:    Export-OrionMapFiles.ps1

    Author:      Kevin M.  Sparenberg (



      This script will  export the Orion Maps (and associated files) from an active Orion System.  By

    default this script will export ALL maps and associated files  (including images).  To change it to

    only export hte OrionMap files comment out or remove the "Exports only the Maps" region.

      Export Path is to the  current user's desktop.  This can be  modified within the "Setup Variables &

    Connect to the SolarWinds Information Service (SWIS)"  region.


    This version is set to use the "username/password"  authentication process.  This can be  changed to

    AD-credentials with some minor tweaking (TBD).


      You must have OrionSDK Installed (Link:

      (tested with version 1.10)

    Version History: [P = Past, C = Current, F = Future]

      (P) 1.0.0 - Initial  Release (2015-07-22)

      (C) 1.0.1 - Update  the path check for custom icons (2015-08-10)

      (F) 1.1.0 -  Conversion to a PowerShell Function (TBD)

      (F) 1.2.0 - Allow for  Multiple Authentication Types (TBD)

    Tested against:

      Orion Platform  2015.1.2

      SAM 6.2.1

      DPA 9.2.0

      QoE 2.0

      IPAM 4.3

      NCM 7.4

      NPM 11.5.2

      NTA 4.1.1

      OGS 1.0.10

      WPM 2.2.0

      SRM 6.1.11

      Toolset 11.0.1

      UDT 3.2.2

      IVIM 2.1.0

      VNQM 4.2.2



    #region Setup Variables & Connect to the SolarWinds  Information Service (SWIS)

    Add-PSSnapin -Name SwisSnapin -ErrorAction SilentlyContinue

    # The username for a user with admin  level permissions

    $SwisUsername = "admin"

    # The poassword for said user (in plain text)

    $SwisPassword = "@ppStack1"

    # The IP, machine name, or alias for the associated Orion  Instance

    $SwisHost    = "orionweb.demo.lab"

    $SwisCredentails = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $SwisUsername, ( ConvertTo-SecureString $SwisPassword -AsPlainText -Force )

    # Export Path for the Files

    $ExportPath = "$env:userprofile\Desktop\OrionMapFiles"


    #region Exports the Maps Only

    $SwqlQuery = @"

    SELECT FileName, FileData

    FROM Orion.MapStudioFiles

    WHERE FileType = 0 AND IsDeleted = False

    ORDER BY FileName



    #region Exports the Maps and any associated files

    $SwqlQuery = @"

    SELECT FileName, FileData

    FROM Orion.MapStudioFiles

    WHERE IsDeleted = False

    ORDER BY FileName



    #region Collect the files to a local object

    $SwisConnection  = Connect-Swis -Hostname $SwisHost -Credential $SwisCredentails

    $OrionMapFiles = Get-SwisData -SwisConnection $SwisConnection -Query $SwqlQuery



    Remove-Variable -Name SwisConnection -Force -Confirm:$false -ErrorAction SilentlyContinue

    $TotalMapFiles = $OrionMapFiles.Count


    #region Check for Path Existence.  If the path doesn't exist, then it's created.

    if ( -not ( Test-Path -Path $ExportPath -ErrorAction SilentlyContinue ) )


        Write-Host "Path: '$ExportPath' does not  exist.`nCreating Export  Folder..." -ForegroundColor Yellow

        New-Item -ItemType Directory -Path $ExportPath | Out-Null



    #region Cycle through each file and export to the file system

    For ( $i = 0; $i -lt $TotalMapFiles; $i++ )


        Write-Progress -Activity "Exporting  Orion Map Files" -CurrentOperation "Exporting $( $OrionMapFiles[$i].FileName )" -Status "Exporting $( $OrionMapFiles[$i].FileData.Length ) bytes" -PercentComplete ( ( $i / $TotalMapFiles ) * 100 )

        #region Added  for verison 1.0.1 for Custom Icons

        # Check for  the "Full Path" and create it, if it doesn't exist.

        $ExportFullPath = ( Join-Path -Path $ExportPath -ChildPath $OrionMapFiles[$i].FileName )

        $ExportDirectory = Split-Path -Path $ExportFullPath -Parent

        if ( -not ( Test-Path -Path $ExportDirectory -ErrorAction SilentlyContinue ) )


            Write-Warning "Creating [$( $ExportDirectory )] Folder"

            New-Item -Path $ExportDirectory -ItemType Directory | Out-Null



        $OrionMapFiles[$i].FileData | Set-Content -Path ( Join-Path -Path $ExportPath -ChildPath $OrionMapFiles[$i].FileName ) -Encoding Byte -Force


    Remove-Variable OrionMapFiles

    Write-Progress -Activity "Exporting Orion Map Files" -Completed


    I'd love feedback from the community on what you think about this and what you think of my plans going forward.