Automate Licensing

Q:  How can I automate the process of downloading and installing the Aurora license file?

Generally, when Aurora users install the model on a machine the licensing process is very straightforward. However, in certain cloud server environments, where automated processes create virtual machines, the licensing process may need to be automated as well. The following PowerShell script can be used to automatically download and install the Aurora license file. Copy and paste the text into your script and update the username and password fields with your Support website information.

<# This example PowerShell script allows you to automate the download and installation of your Aurora license file. #>

<# You must replace the mysupportusername and mysupportpassword below to use your energyexemplar.com Aurora client portal website username and password. #>

<# Execution policy must be set to run PowerShell scripts...please run the following command if you have trouble running this script: #>

<# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned #>

$saved = $false

add-type –path "C:\Program Files (x86)\Aurora\EPIS.Licensing.dll"

$licenseManager = new-object –typename EPIS.Licensing.SoftwareLicenseManager

$licenseObject = new-object –typename EPIS.Licensing.LicenseModel

$id = $licenseManager.GetMachineID()

$licenseDownloadResult = $licenseManager.GetLicense([ref] $licenseObject, “licensing.epis.com”, “mysupportusername”, “mysupportpassword”, “”, “”, $id, “”)

if ($licenseDownloadResult.Success)

{

    $saved = $licenseManager.SaveLicenseFile($licenseObject.LicenseFile);

    if ($saved)

    {

        echo “Successfully retrieved and saved license file.”

    }

    else

    {

        echo “Could not save license file. Please verify permissions to the folder: C:\ProgramData\Energy Exemplar\Aurora”

    }

}

else

{

    echo "Failed to retrieve license file from server. Please check username and password."; Write-Host "Error Code: " $licenseDownloadResult.HttpResponseCode

}

 

Alternatively, you can use any .NET language to register Aurora and download your license.  Here is a sample function that uses a more detailed wrapper API, and demonstrates how you might do this from .NET:

{

        bool VerifyLicense(string username, string password, ref string msg)

        {

            bool haveValidLicense = false;

            msg = "";

 

            XmpSecurity security = new XmpSecurity();

 

            if (security.HaveLicense())

            {

                LicenseStatus status = LicenseStatus.Unknown;

 

                XmpLicense license = new XmpLicense();

                status = security.ValidateLicense(ref license);

                haveValidLicense = (status == LicenseStatus.Valid);

            }

 

            if (haveValidLicense)

            {

                msg = "Aurora license is valid.";

            }

 

            if (!haveValidLicense)

            {

                security.ResetLicense();

                security.Credentials = new System.Net.NetworkCredential(username, password);

                haveValidLicense = security.AcquireLicense(ref msg, true);

            }

 

            return haveValidLicense;

        }

 

 FAQs

 Automate Licensing


For further assistance, please contact Aurora Support.

Copyright© 1997-2024 Energy Exemplar LLC. All rights reserved.