Command Line Options
Sharperlight Command Line Options allow for the installation, setup, automation and scheduling of operations such as setting connections, creating instances, adding users, importing packages, open windows, exporting reports and executing writebacks etc.
Command Lines are executed using the Application file called md.Applications.exe found in the installation folder. Add the required parameters listed below depending on the task being executed.
C:\Program Files\phiLight\SharperLight\bin\md.Applications.exe
Command Line variables %programfiles% to help locate md.Applications.exe as follows
“%programfiles%\phiLight\SharperLight\bin\md.Applications.exe”
In general most of the commands will require an valid user account to access the system and these details are passed in two ways. If Sharperlight has been setup to trust the Windows or Azure AD Account that the command line execution is running under then this account will automatically be used without adding user details to the command line. If a Windows/Azure AD Account can not be used then use the user:xxxx and password:xxxx command line options to set the Account and Password. If you want to encrypt the user name and password as a token then See the Web Channel help on user tokens. In this case the token is placed in the user:token parameter.
Errors and Responses
The command line will echo any errors to the standard output which can be redirected to a file by using the redirect symbol > For example > %temp%\error.txt will redirect any errors to a file in the temp folder which the contents can be seen by executing type %temp%\error.txt In addition to this command lines will write errors to the Windows Event Log.
Note: Command Lines like /CompileAll may take some time to complete but the command will return straight away leaving the it executing in the background. To prevent this always use the start /wait to force the command lines to wait until the task is complete before returning. If this is not done the next command line is executed before the first is complete causing issues.
start /wait md.Applications.exe / CompileAll
Command Types
Setup
- /Connection – Enable specific connections in Client Setup
- /ConnectionLocalSet – Update and Enable Client Setup Local Connection details
- /RemoteConnectionSet – Update, Enable and Delete Client Setup Remote Connection details
- /ServiceConnectionSet – Update, Enable and Delete Client Setup Service Connection details
- /CompanySet – Site Setup Company Details
- /ProductSettingsSet – Site Setup Product Settings
- /User – Site Setup Add, Delete and Update User accounts
- /Import – Import export file including Scheduler Tasks, Publisher, Dash Pages, Report Rows and Licenses
- /InstanceNew – Create a new Instance
- /InstanceDelete – Delete a Instance
- /PowerBiInstall – Ensure that the Sharperlight PowerBI addin is installed into PowerBi
- /InstallDatabase – Ensure that a blank Sharperlight database is initialised with the required tables
- /ServiceRestart – Restart the Sharperlight Windows Service
- /ServiceSetAll – Start, Restart and Stop Sharperlight Windows Services including Instances
- /CompileAll – Force a compile of Datamodel files (Stop all apps and services first)
Reporting
- /QueryExecute – Save Queries or Publisher reports in various formats like CSV, XML, JSON, TEXT, HTML, Excel and PDF
- /ReportPackFile – Sharperlight Explorer
- /ExcelExport – Calculate and Save Excel workbooks as XLSX, CSV, HTML, PDF
- /GetWebPage – Save a web page to a file
Processing
- /MqTableRefresh – Update a Materialised Query Table
- /MqDatabaseRefresh – Update the whole Materialised Query Database
- /ProcessServerSide – Trigger a Datamodel Process on the Server
- /ProcessClientSide – Trigger a Datamodel Process Client side
- /Writeback – Execute a writeback based on a CSV.
- /Task – Trigger the execution of a Scheduler Task with parameters
General Examples
Save Excel as PDF
“%programfiles%\phiLight\SharperLight\bin\md.Applications.exe” /ExcelExport “C:\MyTasks\ReportsMonthlyBudget.xlsx” “C:\MyTasks\Output\MonthlyBudget.pdf” “Budget”
Save Published Report as PDF
md.Applications.exe /QueryExecute “publisher:ACCT.AccntCat” “C:\MyTasks\Output\AccntCat.pdf”
Import Publisher Export File
md.Applications.exe /import “file:C:\Temp\Test.pbqlist” “mode:compare” “UserName:admin” “Password:” > %temp%\errors.txt
Add User to Site Setup
md.Applications.exe /user “mode:add” “AdminUser:admin” “AdminPassword:” “UserName:Sales” “Group:<default>” “Password:S@les351#” “Description:Sales Department” “Email:sales@staging-sharperlight-com.stackstaging.com” “ChangePassword:Yes” “2FA:SL5DB37F63AXX54W” “IsAdmin:No” “Language:en”
Change Database Connection
md.Applications.exe /ConnectionLocalSet System “ConnectionName:Microsoft SQL Server (Database Server Authentication)” “ServerName:mylocalhost” “InitialCatalog:mycatalog” “UserId:sa” “Password:#ewiWsfn2$2”
/Instance:####
When multiple instances of the Sharperlight Windows Service have been started on the same Server the /instance:#### command will be required as the first parameterto speicify which instance to target. Each instance will have a 4 letter code which can be see in Instance Manager.
md.Applications.exe /Instance:6c9f /QueryExecute “queryFileName” “<optionalOutputFileName>” “filter:name1=value” “filter:name2=value” “title:My Report Title” “service:###” “user:xxx” “password:”
/Connection
Local Connections and Remote Connections are configured and enabled in Client Setup. By default only enabled Connections are used but this can be overriden with this option where the codes of the connection are listed in a comma separated list. Only the connections in the list will be enabled and in this way you can target specific Remote Connections for various tasks. For example if there were three Remote Connections 001,002 and 003 and a Local Connection /Connection “Local,002” would just enable the Local Connection and Remote Connection 002. Notice the keywork Local is used to enable for Local Connections
This command line option should be used at the begining of the command line and if /Instance is present then just after it. Sharperlight Version 3.0.3 or higher is required
Enable Local Connections and Remote Connections 003 and 007
/Connection “Local,003,007”
Enable just Remote Connection 002
/Connection “002”
Use Instance ABC with Local and Remote Connection 003
/Instance:ABC /Connection “Local,003”
/QueryExecute
Useful for returning query results in various file formats, running queries that Email reports and refreshing Publisher Cached data
The output file name can also use special date and time tags to pick up the current date time and place it inside the file name itself e.g {_Date} {_DateTime} and {Time}
When executing Publisher reports “publisher:Group.Code” and the Page Designer templates are used when creating the output file. This means if you have created a custom template in Page Designer for example the PDF output will be based on this giving for example a Invoice form output for the specified Invoice no
Format for Query Files
md.Applications.exe /QueryExecute “queryFileName” “<optionalOutputFileName>” “filter:name1=value” “filter:name2=value” “title:My Report Title” “service:###” “user:xxx” “password:”
Format Published Reports
md.Applications.exe /QueryExecute “publisher:Group.Code” “<optionalOutputFileName>” “filter:name1=value” “filter:name2=value”
· Supported output formats are pdf, doc, xls, csv, txt, html, htm, txt, json, js and xml
· Default output format is csv for unknown file extensions
· Requires Windows Integrated security so logon goes through when scheduled
· Output Filenames can have the follower tags {_DateTime} {_Date} {_Time} embedded
· Override default Query Filter values is optional and the new values are assigned to the Query Filters names
md.Applications.exe /QueryExecute “publisher:Group.Code” “C:\Temp\Result.htm>” “filter:Company=ABC” “filter:Period=2010/11/23” “title:My Custom Report Title”
Query File Examples
md.Applications.exe /queryexecute “C:\Users\Ivon\Documents\ADVW-Ranking.xml” “C:\Temp\text{_DateTime}.txt”
md.Applications.exe /queryexecute “C:\Users\Ivon\Documents\ADVW-Ranking.xml” “C:\Temp\text{_Time}.csv”
md.Applications.exe /queryexecute “C:\Users\Ivon\Documents\ADVW-Ranking.xml” “C:\Temp\text{_Date}.html”
md.Applications.exe /queryexecute “C:\Users\Ivon\Documents\ADVW-Ranking.xml” “C:\Temp\text{_Date}.html” “title:Report Title”
md.Applications.exe /queryexecute “C:\Users\Ivon\Documents\ADVW-Ranking.xml” “C:\Temp\text.json”
md.Applications.exe /queryexecute “C:\Users\Ivon\Documents\ADVW-Ranking.xml” “C:\Temp\text.xml” “filter:ReportDate[1]=2002/1/1”
Published Query Examples
md.Applications.exe /queryexecute “publisher:Group.Code” “C:\Temp\MyReport.html” “filter:ModDat[1]=2002/1/1” “filter:ModDat[2]=2002/1/30”
md.Applications.exe /queryexecute “publisher:ADVW.Report1” “C:\Temp\MyReport.pdf” “filter:ModDat[1]=2002/1/1” “filter:ModDat[2]=2002/1/30” “service:001”
/ReportPackFile
Open SharperLight Explorer with the specified report pack file. The file can also be a web url address
md.Applications.exe /reportpackfile “C:\Temp\MyReport.xrp”
/Solution
Execute a Product Solution based on its unique Service code, Product code and Solution GUID
md.Applications.exe /solution “001” “ADVW” “c247d24e-d298-4b05-8bbb-22a095dba4b2”
/ProcessServerSide
Execute a Product Server Side Solution based on its unique Service code, Product code, Module code and Solution Code
md.Applications.exe /solution “001” ”ADVW” ”DataEntry” ” WriteBackServerSideContact”
md.Applications.exe /solution “001” ”ADVW” ”DataEntry” ” WriteBackServerSideContact” “user:guest” “pwd:xxx”
/ProcessClientSide
Execute a Product Client Side Solution based on its unique Service code, Product code, Module code and Solution Code
md.Applications.exe /solution “001” ”ADVW” ”DataEntry” ” WriteBackClientSite”
/ExcelExport
Set values in a Excel workbook, calculate it and then export to html, pdf or xps file format. Leave the Sheet name blank to output all sheets in a workbook. If Windows integrated security is used the username and password can be left blank. It is also possible to use an SHA256 encrypted user token see Web Channel Help for user details when Windows Accounts can not be used. Setting values in the Sheets as a form of parameterisation is optional but when required the format is SheetName!CellLocationOrNamedRange=value
The output file name can also use special date and time tags to pick up the current date time and place it inside the file name itself e.g {_Date} {_DateTime} and {Time}
md.Applications.exe /excelExport “inputExcelFileName.xls” “outputFileName ” “optionalSheetName” “UserNameOrToken” “password” “optionalSheet!CellLocationOrNamedRange=Value” “optionalSheet!CellLocationOrNamedRange=Value2″ “optionalSheet!CellLocationOrNamedRange=Value(n)”
User Details
md.Applications.exe /excelExport “C:\Temp\TestXLPublish.xlsx” “C:\Temp\Test.html” “” “guest” “”
md.Applications.exe /excelExport “C:\Temp\TestXLPublish.xlsx” “C:\Temp\Test.html” “Sheet1” “guest” “password” “Sheet1!A1=ZZZ” “Sheet1!C2=2002/03” “Sheet2!A1=S2”
Single Sign On
md.Applications.exe /excelExport “C:\Temp\TestXLPublish.xlsx” “C:\Temp\Test.html” “Sheet1” “” “” “Sheet1!A1=ZZZ” “Sheet1!C2=2002/03” “Sheet2!A1=S2”
md.Applications.exe /excelExport “C:\Temp\TestXLPublish.xls” “C:\Temp\Test.pdf” “”
/MqDatabaseRefresh
Refresh the data for all the enabled Tables in a Materialised Query Database. If Tables have been setup for Delta updates then this will be how the data is refreshed. Also if Tables have dependencies then the order of refresh respects these settings.
md.Applications.exe /mqDatabaseRefresh “dbCode”
md.Applications.exe /mqDatabaseRefresh “dbCode” “service:001”
md.Applications.exe /mqDatabaseRefresh “dbCode” “service:001” “user:guest” “password:”
/MqTableRefresh
Refresh the data of the specified Materialised Query Table.
If Table has been setup for Delta updates then this will be how the data is refreshed.
If Table has dependencies then the order of refresh respects these settings
md.Applications.exe /mqTableRefresh “tableCode” “database:Code”
md.Applications.exe /mqTableRefresh “tableCode” “database:Code” “service:Code”
md.Applications.exe /mqTableRefresh “tableCode” “database:Code” “user:guest” “password:”
/Writeback
Use a CSV file as a source for a writeback into the specified Product simular to the way writeback can be done in Excel. The CSV file format is very strict, all values need to be enclosed in double quotes, a comma as the seperator and not spaces around the comma.
To best understand what column data is required for the target Table use Excel Writeback to select the Table and have a look at the Fields/Columns that appear. The CSV file will require the same number of Columns of the correct Data Types in the same order. If errors do occure the details can be found in the output file and also the Windows Event log as a Error category. If no errors occure a Information Event log is created and OK is output to the text file along with the number of Records Affected.
CSV file example showing a header row and two data rows
“Code”,”Description”,”Date”,”Amount”
“AX1618″,”Computer Equipment”,”2013-05-25″,”1234.90″
“DA1414″,”Phone Equipment”,”2013-05-27″,”850.15″
Sharperlight can create CSV files based on Queries. If you are unsure of a valid CSV file format use Query Builder Preview to save a CSV file.
Parameters
-
Inputfile:
-
The input CSV Filename with full path. The file name can also use special date and time tags to pick up the current date time and place it inside the file name itself e.g {_Date} {_DateTime} and {Time}
-
-
OutputFile:
-
Status results are written to this file in text format .The file name can also use special date and time tags to pick up the current date time and place it inside the file name itself e.g {_Date} {_DateTime} and {Time}
-
-
Service:
-
(Optional) If more than Remote Connection is present then the Service Code is required to direct the writeback to the correct Service. If the command line is on the Application Server then this is not required
-
-
Product:
-
The Internal Product code. This code can be found in Client Setup by clicking on the Product and checking the Property grid
-
-
SuperField:
-
(Optional) Some Products have a concept of a Company or Business Unit that required before the Table can be selected. Enter a valid Company / Business Unit value to target with the writeback
-
-
Table:
-
Each Table in a Product has a unique internal Code. To find the Table Internal Code use the Table Lookup in Query Builder and select Information. The Table determines the Table to writeback to. Make sure the CSV has the same number of columns to make the Table writeback.
-
-
Mode:
-
(Optional) If not set the writeback will validate and if no errors are detected then the data is updated or inserted depending on the how the product handles the data. For example to just validate data the Mode would be set to Mode:Validate.
-
Mode:Validate
-
Only Validate to not writeback data
-
-
Mode:Delete
-
Delete Mode, used for clear down
-
-
Mode:Break
-
Break on first error found. Do not continue
-
-
Mode:UniqueKey
-
Update/Insert logic based only on unique key
-
-
-
-
Header:
-
(Optional) By default a Header Row is excepted. If no Header row is present the use Header:No otherwise Header:Yes
-
-
User:
-
(Optional) If Windows Authenication is not used then a Sharperlight User Account is required
-
-
Password:
-
(Optional) See User
-
Basical Example
md.Applications.exe /writeback “Service:“ “Product:GDP”, “SuperField:ABC” “Table:Ledger” “InputFile:C:\Data\JournalImport.CSV” “OutputFile:C:\Data\JournalImport.txt” “User:guest” “Password:”
Validate Only
md.Applications.exe /writeback “Service:“ “Mode:Validate” “Product:GDP” “SuperField:ABC” “Table:Ledger” “InputFile:C:\Data\JournalImport.CSV” “OutputFile:C:DataJournalImport.txt” “User:guest” “Password:”
Service Code
md.Applications.exe /writeback “Service:002” “Product:GDP” “SuperField:ABC” “Table:Ledger” “InputFile:C:\Data\JournalImport.CSV”
Version 5.0.94 or higher required for the following commands
/Import
Import various export files such as Publisher, DashPage, Reporting Rows and License files. In the case of export lists these are created by using the Export options menu and will have a file extension ending in list. For example, tasklist, pbqlist, dbplist and rprlist with the exception being a license file lic. Note that if a compressed zip file is imported the various file contained in the zip will be imported and any unsupported file types will be ignored. Sharperlight can create backup zip files of the complete system and these files can be used with the import command line to restore or deploy packages. By default, a comparison is done with the existing items based on the version and date. If the import item is the same or a earlier version it will be skipped. The override this behaviour and force a complete replace set the mode to replace but this will require an admin account to execute.
Note that, license files require an admin account to import the details. Also if the existing item has been owner locked it will require an admin account to override the existing item.
Parameters
- Mode: Valid values are compare or replace defaults to compare
- File: Import file path. Can be zip file containing many file types.
- UserName: This is optional if the Windows AD account is trusted in Site Setup
- Password: Site Setup User password when not using Windows AD
Examples
md.Applications.exe /import “file:C:\Temp\Test.tasklist” “mode:compare” “UserName:admin” “Password:” > %temp%\errors.txt
md.Applications.exe /import “file:C:\Temp\Test.pbqlist” “mode:compare” “UserName:admin” “Password:” > %temp%\errors.txt
md.Applications.exe /import “file:C:\Temp\Test.dbplist” “mode:compare” “UserName:admin” “Password:” > %temp%\errors.txt
md.Applications.exe /import “file:C:\Temp\Test.rprlist” “mode:compare” “UserName:admin” “Password:” > %temp%\errors.txt
md.Applications.exe /import “file:C:\Temp\License-PHI-App-2021-05-31.lic” “UserName:admin” “Password:” > %temp%\errors.txt
md.Applications.exe /import “file:C:\Temp\SL_BAK_20200802_053437.zip” “mode:compare” “UserName:admin” “Password:” > %temp%\errors.txt
/CompanySet
Set the Site Setup Company details. This requires that the logon account has admin permissions. If the parameter is not set then the field is set as blank.
- ServiceCode: This is optional
- AdminUser: This is optional if the Windows AD account is trusted in Site Setup
- AdminPassword: Site Setup User password when not using Windows AD
Example
md.Applications.exe /CompanySet “Name:Philight Pty Ltd” “Address1:147-149 Colin Street” “Address2:” “City:Perth” “PostCode:6005” “State:WA” “Country:AU” “Phone:0403 274 555” “Fax:” “Email:support@staging-sharperlight-com.stackstaging.com” “WebSite:www.staging-sharperlight-com.stackstaging.com” “UserName:admin” “Password:”
/ProductSettingsSet
Set the Site Setup Product Settings details. This requires that the logon account has admin permissions. If the parameter is not set then the existing field value is preserved. Note: that the parameters can be set based on their English Description or Datamodel Internal code. The match is done by removing all spaces and special charactors and if not found a list of the unfound parameter is returned. Parameter with match are still set even if some are not found. If Windows AD signle sign is active then the admin user account and password is not required.
- ServiceCode: This is optional
- AdminUser: This is optional if the Windows AD account is trusted in Site Setup
- AdminPassword: Site Setup User password when not using Windows AD
- Product: The Datamodel Product Code e.g. System or SAPBusOne etc.
- ParameterDescOrCode: The parameter English description or code. View the list in Site Setup
Example
md.Applications.exe /ProductSettingsSet” “ServiceCode:” “AdminUser:admin” “AdminPassword:” “Product:System” “SecureFolders:C:\Temp|D:\Projects” “AllowSchedulerFilesInFolder:C:\Scheduler” “AllowSchedulerServerSide:true” “GoogleApiKey:AIzaSyDMzZtdUYwEjjIIOK29iMj0hdcjo6xJMFF”
/User
Add, Update, Enable, Disable and Delete Site Setup users accounts. This requires that the logon account has admin permissions. If a parameter is not set then it is assumed to be blank and when updating the existing information is left unchanged.
Parameters
- Mode: Validate values are add, update, enable, disable and delete
- AdminUser: The admin user to gain access to Site Setup. This is optional if using Windows AD to signal sign on
- AdminPassword:
- UserName: The Site Setup user account to add, change or delete. If the keyword [CurrentUser] is used it will get the current Window AD User Account.
- Group: The User Group to assign to the User account. If the mode is add then it will use the default group when left blank or set to <default>.
- Description: The user description
- Email: The user email details
- Password: If the User Type is a Windows AD account then the password is not required.
- ChangePassword: Yes/No
- 2FA: The Two Factor Authentication string to use (optional)
- IsAdmin: Yes/No
- Language: The default language for the user. For example en, ja, fr, es etc
- Type: The type of user account. Valid values are Azure, Microsoft, Windows, LDAP and Sync
Examples
md.Applications.exe /user “mode:add” “AdminUser:admin” “AdminPassword:” “UserName:Sales” “Group:<default>” “Password:S@les351#” “Description:Sales Department” “Email:sales@staging-sharperlight-com.stackstaging.com” “ChangePassword:Yes” “2FA:SL5DB37F63AXX54W” “IsAdmin:No” “Language:en”
md.Applications.exe /user “mode:add” “AdminUser:admin” “AdminPassword:” “UserName:[CurrentUser]” “Group:Admin” “Description:Admin Support” “IsAdmin:Yes” “type:Windows”
md.Applications.exe /user “mode:add” “AdminUser:admin” “AdminPassword:” “UserName:ivon@Sharperlight.com” “Group:Admin” “Description:Ivon Robson” “IsAdmin:Yes” “type:Azure”
md.Applications.exe /user “mode:add” “AdminUser:admin” “AdminPassword:” “UserName:Sharperlight-G3\Ivonr” “Group:Admin” “Description:Ivon Robson” “IsAdmin:Yes” “type:Microsoft”
md.Applications.exe /user “mode:disable” “AdminUser:admin” “AdminPassword:” “UserName:Sales”
md.Applications.exe /user “mode:enable” “AdminUser:admin” “AdminPassword:” “UserName:Sales”
md.Applications.exe /user “mode:update” “AdminUser:admin” “AdminPassword:” “UserName:Sales” “Password:S@les35222#”
md.Applications.exe /user “mode:update” “AdminUser:admin” “AdminPassword:” “UserName:Sales” “Group:SalesGroup”
md.Applications.exe /user “mode:delete” “AdminUser:admin” “AdminPassword:” “UserName:Sales”
/ConnectionLocalSet
Set and enable the database connection details in Client Setup for the specified Product and Connection template. If not all the parameters are provided then a fizzy match is done to best find the connection template that matchs. The varous properties are matched on the description or code of the property with all the spaces and special charactors removed.
Parameters
- First Parameter: The Datamodel Product Code for the connection. For example System or SAPBusOne.
- ConnectionName: The connection template description to target. This is optional but helps when connection templates look very simular
- <Property_Code_Or_Description>
Examples
md.Applications.exe /connectionLocalSet System “ServerName:Localhost” “InitialCatalog:Sharperlight” “UserID:sa” “Password:X%hd1#23$xxx”
md.Applications.exe /connectionLocalSet System “ConnectionName:Microsoft SQL Server (Windows Authentication)” “ServerName:localhost” “InitialCatalog:Sharperlight”
md.Applications.exe /connectionLocalSet SAPBusOne “ConnectionName:SAP HANA – ODBC” “Server and Port:MyHanaServer:30015” “SBO Database:SBOCOMMON” “User Name:SYSTEM” “Password:KDff%3oiw@”
/RemoteConnectionSet
Add, update, enable and delete Client Setup Remote Connections based on the mode parameter. The mode when left blank will update existing entries and if the code is not found it will add a new entry. The Enable parameter when left blank will enable the updated or new Remote Connection and disable all others. In other words, to enable multiple Remote Connections always set the Enable parameter so that other Remote Connections Enabled states are not reset. If all the Remote Connections are disabled then Local Connections will be auto enabled. If a Remote Connection is upated or added and the Enable parameter is not specified the Local Connections will be auto disabled as it is assumed that it’s a Client Install just requiring Remote Connections.
Parameters
- Mode: <Default>=Auto update or add, Add=Add new entry, Update=Update existing entry and Delete.
- Code: The Remote Connection Code to add, update or delete
- Description:
- Enable: Only set when multiple Remote Connections are required and their enable states need to be preserved
- ServerName: The App Server name or public domain name e.g. MyCompanyName or www.MyCompany.com
- ServiceCode: The App Server Sharperlight Service Code e.g. mdService1, mdService2, UAT, PROD or MyCode etc
- Protocol: HTTP, HTTPS or TCP
- Port: The port no. When left blank if will assume it is port 4001 for HTTP and TCP and 443 for HTTPS
- ConnectionTimeout: Number of seconds before timing out Remote Connections. Default is 0
- Password: The Service password which is the maybe required depending on the App Server Service settings
- AliasCode: Optional – Comma delimited list if codes than can be redirected to this Remote Connection.
Examples
md.Applications.exe /RemoteConnectionSet “Code:001” “Description=Production Server UK” “ServerName=ProdServer01” “ServiceCode:mdService1” “Protocol=Http” “Port=4001” “ConnectionTimeout=0” “Password=” “AliasCodes=”
md.Applications.exe /RemoteConnectionSet “Mode:Update” “Code:001” “ServerName=ProdServer02”
md.Applications.exe /RemoteConnectionSet “Mode:Delete” “Code:001”
md.Applications.exe /RemoteConnectionSet “Mode:Add” “Code:USA” “Enable:True” “Description=Region Server US” “ServerName=www.MyCompany.com” “ServiceCode:RegionUS” “Protocol=Https” “Port=443” “ConnectionTimeout=0” “Password=#kdY5459$M32” “AliasCodes=”
md.Applications.exe /RemoteConnectionSet “Mode:Add” “Code:UK” “Enable:True” “Description=Region Server UK” “ServerName=www.MyCompany.uk” “ServiceCode:RegionUK” “Protocol=Https” “Port=443” “ConnectionTimeout=0” “Password=#kdrwe$M88” “AliasCodes=”
md.Applications.exe /RemoteConnectionSet “Mode:Update” “Code:UK” “Description=Region Server UK” “ServerName=www.MyCompany.uk” “ConnectionTimeout=999”
/ServiceConnectionSet
Add, update, enable and delete Client Setup Service Connections based on the mode parameter. The mode when left blank will update existing entries and if the code is not found it will add a new entry. The Enable parameter when left blank will enable the updated or new Service Connection and disable all others. Note that only one Service can be enabled at any one time so it’s best to not use the Enable settings. If parameters are omitted then the existing or default value is used.
Parameters
- Mode: <Default>=Auto update or add, Add=Add new entry, Update=Update existing entry and Delete.
- Code: The Serice Connection Code to add, update or delete
- Description: Service Description e.g. Sharperlight Production System
- Enable: True or False (Best to not use this parameter and allow the system to auto set)
- Password: The Service password (Optional) The client Remote Connection will require this password to connect
- ExternalBaseAddressUrl: When blank it will default to the server name. If using on the internet set to the domain name. e.g. www.mycompany.com
- ExternalProxyAddressUrl: See the property notes on the parameter in Client Setup
- ServiceCode: The App Server Sharperlight Service Code e.g. mdService1, mdService2, UAT, PROD or MyCode etc
- Protocol: HTTP, HTTPS or TCP
- PortNumber: The port no. When left blank if will assume it is port 4001 for HTTP and TCP and 443 for HTTPS
- WebChannelPortNo: When left blank will be 443 for HTTPS and 80
- ConnectionTimeout: Number of seconds before timing out Remote Connections. Default is 0
- Authentication: [Default, Basic, Kerberos, NTLM and Windows].
- SecurityLevel: [Normal, Medium, Hight and VeryStrict]
- ActiveDirectoryDomainDefault: Set the default AD domain so users can omit the domain name when signing in
- AllowMaterialisedDatabase: [True/False] Allow Materialised Database to be created and accessed by the Service
- AllowMaterialisedDatabaseList: List the MQ Databases the Service is restricted to (Comma delemited)
- AllowRemoteSiteSetup: [True/False] Allow Site Setup by Clients using Remote Connections (Normally only accessible on App Server)
- AllowTwoFactorAuthentication: [True/False] Enable or Disable 2FA authentication on the Service (Default is true)
- AllowUserPasswordChange: [True/False] User can change password on Web Channel
- AllowUserPasswordReset: [True/False] User can reset password on Web Channel (Requires email setup)
- AllowUserCreation: [True/False] Admin Users can create their user accounts on the Web Channel
- AllowUserMaintenanceByOwner: [True/False] Users can create their own signin as seen in many web sites (Requires email setup)
- AllowUserDeletion: [True/False] Allow deletion of user accounts by admin on Web Channel or by owner of account
- LogoImage: File path or URL address of logo picture to display above the Logon page. e.g C:\Branding\CompanyLogo.jpg
- LogoImageHeight: Logon page logo picture height e.g. 60
- TitleBackgroundColor: Logon page title bar background html color e.g. #3f48cc
- TitleFontColor: Logon page title font html colour e.g. #ffffff
- EmailOutgoingServer: Email Host SMTP Server e.g. smtp.gmail.com
- EmailPortNumber: Port no e.g. 21 Leave blank and the system will auto set
- EmailUserName: The Email sign in account e.g. myaccount@gmail.com
- EmailPassword: The Email sign in account password
- EmailUsesSsl: [True/False] Will the Email use SSL or not
- EmailFromAddress: The email address to use as the default from address (Used by processes)
Example HTTPS
start /wait md.Applications.exe /ServiceConnectionSet” “Mode:Add” “Code:999” “Description=Sharperlight Server UK” “Password=x#5x&xZ3” “ExternalBaseAddressUrl=www.mycompany.com” “ExternalProxyAddressUrl=” “ServiceCode:mdService1” “Protocol=Https” “PortNumber=443” “ConnectionTimeout=0” “WebChannelPortNo=443” “Authentication:Default” “SecurityLevel:High” “AllowMaterialisedDatabase:true” “AllowMaterialisedDatabaseList:SLMQ_5567ceaa1c83459ca66d7349d5fa5895” “AllowRemoteSiteSetup:true” “AllowTwoFactorAuthentication:true” “AllowUserPasswordChange:False” “AllowUserPasswordReset:False” “AllowUserCreation:False” “AllowUserMaintenanceByOwner:False” “AllowUserDeletion:False” “LogoImage:C:\Branding\CompanyLogo.png” “LogoImageHeight:0” “TitleBackgroundColor:#3f48cc” “TitleFontColor:#ffffff” “EmailOutgoingServer:smtp.gmail.com” “EmailPortNumber:” “EmailUserName:myname@gmail.com” “EmailPassword:#ddsuvj#21” “EmailUsesSsl:True” “EmailFromAddress:fromname@gmail.com”
Example HTTP – Simple
start /wait md.Applications.exe /ServiceConnectionSet” “Mode:Add” “Code:999” “Description=Sharperlight Server UK” “Password=” “ExternalBaseAddressUrl=” “ExternalProxyAddressUrl=” “ServiceCode:mdService1” “Protocol=Http” “PortNumber=4001” “ConnectionTimeout=0” “WebChannelPortNo=” “Authentication:Default” “SecurityLevel:Medium” “AllowMaterialisedDatabase:true” “AllowMaterialisedDatabaseList:” “AllowRemoteSiteSetup:true” “AllowTwoFactorAuthentication:true” “AllowUserPasswordChange:False” “AllowUserPasswordReset:False” “AllowUserCreation:False” “AllowUserMaintenanceByOwner:False” “AllowUserDeletion:False” “LogoImage:” “LogoImageHeight:0” “TitleBackgroundColor:” “TitleFontColor:” “EmailOutgoingServer:smtp.gmail.com” “EmailPortNumber:” “EmailUserName:myname@gmail.com” “EmailPassword:#ddsuvj#21” “EmailUsesSsl:True” “EmailFromAddress:fromname@gmail.com”
/InstallDatabase
This is used to initialize a blank Sharperlight database during a install. If the required Sharperlight tables and objects are not present it will auto create them. The System Connection requires valid connection details with full dbo rights for this to work.
md.Applications.exe /InstallDatabase > %temp%\error.txt
/ServiceRestart
Restart the Sharperlight Windows Service. Note if the /instance:code is used it will restart the target Instance. Windows Local Admin permissions are required to start and stop Windows Services
/ServiceSet
Start or Stop the Sharperlight Windows Service. Note if the /instance:code is used it will restart the target Instance. Windows Local Admin permissions are required to start and stop Windows Services
Parameters
- Mode: Start and Stop
- Delay: The number of seconds to wait between stopping and starting
Examples
md.Applications.exe /ServiceSet “Mode:Start”
md.Applications.exe /ServiceSet “Mode:Stop”
/ServiceSetAll
Start, Restart or Stop all Instance Sharperlight Windows Services including the primary instance depending on the IncludeMaster parameter. Windows Local Admin permissions are required to start and stop Windows Services
Parameters
- Mode: Start, Restart and Stop
- DelayStartSec: The number of seconds to wait after starting
- DelayStopSec: The number of seconds to wait after stopping
- DelaySec: Default number of seconds to wait between stopping and starting
- IncludeMaster: Yes/No If Yes then the primary instance is also set.
Examples
md.Applications.exe /ServiceSetAll “Mode:Stop” “DelaySec:15” “IncludeMaster:Yes”
md.Applications.exe /ServiceSetAll “Mode:Start” “DelaySec:15” “IncludeMaster:Yes”
Silent install using command lines to complete the configuration
Command lines can be used after the msi installation to setup most of the common settings required. The example after setting the connection details and initializing the System Database then moves onto creating a single sign admin user account in Site Setup. It can use this account to then import licenses, Scheduler tasks and report packs.
Note: Command Lines like /CompileAll may take some time to complete but the command will return straight away leaving the it executing in the background. To prevent this always use the start /wait to force the command lines to wait until the task is complete before returning. If this is not done the next command line is executed before the first is complete causing issues.
Application Server Example
start /wait md.Applications.exe /CompileAll
start /wait md.Applications.exe /InstallDatabase > %temp%\error.txt
start /wait md.Applications.exe /connectionLocalSet System “ConnectionName:Microsoft SQL Server (Database Server Authentication)” “ServerName:Localhost” “InitialCatalog:Sharperlight” “UserID:sa” “Password:X%hd1#23$xxx” > %temp%\error.txt
start /wait md.Applications.exe /ServiceConnectionSet” “Mode:Update” “Code:001” “Description=Sharperlight Server UK” “Password=” “ExternalBaseAddressUrl=” “ExternalProxyAddressUrl=” “ServiceCode:mdService1” “Protocol=Http” “PortNumber=4001” “ConnectionTimeout=0” “WebChannelPortNo=” “Authentication:Default” “SecurityLevel:Medium” “AllowMaterialisedDatabase:true” “AllowMaterialisedDatabaseList:” “AllowRemoteSiteSetup:true” “AllowTwoFactorAuthentication:true” “AllowUserPasswordChange:False” “AllowUserPasswordReset:False” “AllowUserCreation:False” “AllowUserMaintenanceByOwner:False” “AllowUserDeletion:False” “LogoImage:” “LogoImageHeight:0” “TitleBackgroundColor:” “TitleFontColor:” “EmailOutgoingServer:smtp.gmail.com” “EmailPortNumber:” “EmailUserName:myname@gmail.com” “EmailPassword:#ddsuvj#21” “EmailUsesSsl:True” “EmailFromAddress:fromname@gmail.com” > %temp%\error.txt
start /wait md.Applications.exe /user “mode:add” “AdminUser:admin” “AdminPassword:” “UserName:[CurrentUser]” “Group:Admin” “Description:Admin Support” “IsAdmin:Yes” “type:Windows”
start /wait md.Applications.exe /user “mode:update” “AdminUser:admin” “AdminPassword:” “UserName:Sales” “Password:adIn%35222#”
start /wait md.Applications.exe /user “mode:disable” “UserName:guest”
start /wait md.Applications.exe /user “mode:disable” “UserName:user1”
start /wait md.Applications.exe /user “mode:disable” “UserName:user2”
start /wait md.Applications.exe /user “mode:disable” “UserName:user3”
start /wait md.Applications.exe /CompanySet “Name:Philight Pty Ltd” “Address1:147-149 Colin Street” “Address2:” “City:Perth” “PostCode:6005” “State:WA” “Country:AU” “Phone:0403 274 555” “Fax:” “Email:support@staging-sharperlight-com.stackstaging.com” “WebSite:www.staging-sharperlight-com.stackstaging.com”
start /wait md.Applications.exe /import “file:C:\Temp\License-PHI-App-2021-05-31.lic” > %temp%\errors.txt
start /wait md.Applications.exe /import “file:C:\Temp\ReportsAndTasks.zip” “mode:compare” > %temp%\errors.txt
start /wait md.Applications.exe /ServiceSet “Mode:Start”
Client with Remote Connection HTTPS Example
start /wait md.Applications.exe /RemoteConnectionSet “Mode:Add” “Code:UK” “Description=Region Server UK” “ServerName=www.MyCompany.uk” “ServiceCode:RegionUK” “Protocol=Https” “Port=443” “ConnectionTimeout=0” “Password=#kdrwe$M88”
Client with Remote Connection HTTP Example
start /wait md.Applications.exe /RemoteConnectionSet “Mode:Update” “Code:001” “Description=Sharperlight PROD Server” “ServerName=AppServerProd01” “ServiceCode:mdService1” “Protocol=Http” “Port=4001” “ConnectionTimeout=900”
