Background

Sage Estimating creates a configuration file ('ActiveSystemInfo.xml') and stores it in each user's profile (AppData). In a Remote Desktop deployment scenario, the following Powershell script can be deployed, along with the source folders and file to streamline the configuration process. The result is that each user, at login, will receive the required configuration file, if they don't have one already.


Example: Estimating Configuration Wizard



Prerequisites

  • Administrator rights on the RD Session Host
  • Rights to change the local group policies

Steps


Create a Powershell script and source files

Powershell script

  1. Create a Powershell script with the following (or similar).
    Note: If you are uncomfortable with writing, reading, or editing Powershell scripts, please consult your IT department.

    Note: Update the following as required for your deployment.
    # Path to source folder
    # Path to source file

    # Users profile path to Sage Estimating 20.1
    $Path_Roaming_Folder = "$env:userprofile\AppData\Roaming\Sage\Estimating 20.1"
    # Path to source folder
    $SourceFolder = "C:\users\default\AppData\Roaming\Sage\Estimating 20.1"
    # Folder to create if does not exist
    $MD_Sage_Folder = "$env:userprofile\AppData\Roaming\Sage\Estimating 20.1"
    
    # Users profile path to Sage Estimating 20.1 ActiveSystemInfo file
    $XMLPath_Roaming_Folder = "$env:userprofile\AppData\Roaming\Sage\Estimating 20.1\ActiveSystemInfo.xml"
    # Path to source file
    $XMLSourceFile = "C:\users\default\AppData\Roaming\Sage\Estimating 20.1\ActiveSystemInfo.xml"
    # Path to target folder
    $XMLMD_Sage_Folder = "$env:userprofile\AppData\Roaming\Sage\Estimating 20.1"
    
    # ACTION
    if (-not `
        # Test to see if the target path exists
        (test-path -Path $Path_Roaming_Folder)) `
        # if the Source Folder does not exist, then create the folder
        {copy-item $SourceFolder $MD_Sage_Folder -Recurse}
        # Copy the ActiveSystemInfo.xml to the users profile
        copy-item $XMLSourceFile $XMLMD_Sage_Folder -Recurse

  2. Save the script as SageConfigProfile.ps1 (or similar) for use further down in this solution.


Source Files

  1. With a text editor (i.e. Notepad or Notepad++), create a file named ActiveSystemInfo.xml...
  2. The content of the ActiveSystemInfo.xml file should be as follows.

    Update the following:
    • [SQL_SERVER]
    • [SQL_SERVER_INSTANCE]
    • [ESTIMATES_CATALOG_NAME] {default value is "Estimates"}
    • [SAGE_LICENSE_SERVER]
    • [SAGE_LICENSE_PORT_NUMBER] {default value is "48650"}

      <?xml version="1.0" encoding="utf-8"?>
      <EstimatingSystemInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <ServerInstance>[SQL_SERVER]\[SQL_SERVER_INSTANCE]</ServerInstance>
        <EstimatesDatabase>[ESTIMATES_CATALOG_NAME]</EstimatesDatabase>
        <LicensingMode>0</LicensingMode>
        <LicenseServer>[SAGE_LICENSE_SERVER]</LicenseServer>
        <LicenseServerPort>[SAGE_LICENSE_PORT_NUMBER]</LicenseServerPort>
      </EstimatingSystemInfo>

Source Folders

  1. Create the following folders as defined in the # Path to source folder location in the logon script.
    example:
    "C:\users\default\AppData\Roaming\Sage\Estimating 20.1"



  2. Copy the previously created ActiveSystemInfo.xml file and place it in the source folder (ex: Estimating 20.1).



Add a local Group Policy Logon script

  1. Logon to the RD Session Host with Administrative rights.
  2. Open the local machine Group Policy editor (Start > type "edit group policy"... and select "Edit group policy")
  3. Expand Windows Settings under User Configuration...


  4. In the right pane, double-click Logon...


  5. Select the PowerShell Scripts tab...


  6. Select the Show Files... button...


  7. In the Logon folder (%WINDIR%\System32\GroupPolicy\User\Scripts\Logon...), add the previously created Powershell script SageConfigProfile.ps1.



  8. At the Logon Properties window, click the Add button...

  9. At the Add a Script window, click the Browse button...

  10. At the Browse window, select the previously placed Powershell script and click the Open button...

  11. At the Add a Script window, click the OK button...

  12. At the Logon Properties window, click the Apply and then OK buttons...

  13. At the Local Group Policy window, click the 'X' to close the window...


Test the Powershell script

  • Check for the presence of a "Sage" folder in the [Root}:\Users > Username > AppData > Roaming folder...
  • Run the Powershell script...
  • There should now be a "Sage" folder with a subfolder "Estimating 20.1" and a file within it called "ActiveSystemInfo.xml"...