You can carry out certain Administration operations from the Command Line Interface (Silent Mode) or by batch (.bat) file, in the same way you can install Smart Instrumentation.
The CLI involves running a script with arguments specifying the operation to be actioned. A batch file uses the same scripts but written in a text file, such as notepad, and saved as a .bat file. Double clicking the batch file runs the script.
At any time you can call up the CLI help by typing the command name space Question mark (?). For example, RESTORE ?, Upgrade ?, ImportPreferences ? and so forth.
The following are CLI scripts for Silent mode operations in the Administration Module:
-
When you see <> in any of the scripts, you must replace the contents of the<> with the required value and delete the <>. For example, Upgrade <Domain Name>, becomes Upgrade HexagonPPM. Upgrading all Schema's.
-
If there is a connection failure, the procedure is stopped and a message is displayed in the Log file.
Initialize a New Domain from a DDTI Backup File
This action is only available for Smart Instrumentation 13.1 HF10 and higher.
The following script is used to create a new Domain from a DDTI backup file:
init.exe RESTORE,SI,<new domain name>,<new domain schema name>,
<new domain schema password>,<DDTI file full path including file name>,
<copy users and departments flag (Y/N)>,<save last created ID flag (Y/N)>
Script example:
init.exe RESTORE,SI,HexagonPPM,HexagonPPM1,123456789,D:\Backups\SI\Plant123.13062021.ddti,N,Y
Initialize a Domain from a Database Source (not DDTI file)
This action is only available for Smart Instrumentation 13.1 HF11 and higher.
The following script is used to Initialize a Domain using a database (db) file as a source, not a DDTI file.
init.exe RESTORE,DB,<domain name>,<domain schema name>,<domain schema password>,<server>,<database>,
<admin schema name>,<admin schema password>,<source domain name>,
<copy users and departments flag (Y/N)>,<save last created ID flag (Y/N)>
Script example
init.exe RESTORE,DB,HexagonPPM,HexagonPPM1,123456789,Server1,HexagonAB,IN_DBAMN,IN_DBAMN,TestRestore17,Y,Y
Encrypting Passwords
You can encrypt the following passwords using the CLI or batch (.bat) files,
These actions are only available for Smart Instrumentation 13.1 HF11 and higher.
Admin Schema Password
The following script is used to encrypt the Admin Schema Password.
PasswordEncryption.exe ADM <si_sysadmin_login> <si_sysadmin_password>
Example:
PasswordEncryption.exe ADM si_12as34 si_MySysPassword
Domain Schema Passwords
To encrypt all Domain Schema Password type the following in the CLI/Batch file.
PasswordEncryption.exe DOM <si_sysadmin_login> <si_sysadmin_password>
Example:
PasswordEncryption.exe DOM si_12as34 si_MySysPassword
Security Schema Password
The following script is used to encrypt the Security Schema password.
PasswordEncryption.exe S <si_sysadmin_login> <si_sysadmin_password>
Example:
PasswordEncryption.exe S si_12as34 si_MySysPassword
All User Passwords
To encrypt all user passwords type the following.
PasswordEncryption.exe U <si_sysadmin_login> <si_sysadmin_password>
Example:
PasswordEncryption.exe U si_12as34 si_MySysPassword
Run All Encryption Tasks
The following script is used when you want to encrypt all your Admin and Domain Schema passwords, and User passwords in one go.
PasswordEncryption.exe ALL <si_sysadmin_login> <si_sysadmin_password>
Example:
PasswordEncryption.exe ALL si_12as34 si_MySysPassword
Rebuild Stored Procedures and Triggers
Only available from Smart Instrumentation 13.1 HF 12 and higher.
-
This procedure is automatically carried out when you upgrade your database and should only be carried out manually when instructed to do so by Customer Support.
-
If you are asked by Customer Support to rebuild stored procedures and triggers, use the following scripts if you want to do this in silent mode.
CLI for the Admin Schema Name
Upgrade -adminschema
silent
CLI for the Admin Schema ID
Upgrade -9999
silent
Examples:
Using the Admin schema name
Upgrade -adminschema
silent
Using the Admin schema ID
Upgrade -9999
silent
CLI for a Project or Domain Name
Upgrade -<Project (domain) ID>
silent
or
Upgrade -<domain name>
silent
Examples:
Upgrade -12345
silent
or
Upgrade -MyDomain
silent
Rebuild all Stored Procedures and Triggers
This option allows you to rebuild all stored procedures and triggers.
Upgrade -all
silent
Importing Default Preferences
Only available from Smart Instrumentation 13.1 HF 13 and higher.
You can only use these procedures if you have created a .pref file in the Administration
module. For more information, see Export Preferences.
EPCs can only import the preferences of a domain.
Importing default preferences (.pref) for a domain
ImportPreferences IMP,<domainadmin>,<domainadminPWD>,<path to pref>,<targetdomainname>
Example:
ImportPreferences IMP, John Smith, MyAdminPassword, C:\downloads\MyPreferences.pref, New Domain3
Importing default preferences (.pref) for a project
ImportPreferences IMP,<domainadmin>,<domainadminPWD>,<path to pref>,<targetdomainname>,<targetprojectname>
Example:
ImportPreferences IMP, John Smith, MyAdminPassword, C:\downloads\MyPreferences.pref, New Domain3, NewProject 1
The following characters should not be used in a project name as this could cause
problems when exporting a project or when using the Command Line Interface.
@ |
# |
$ |
^ |
_ |
+ |
- |
* |
/ |
\ |
% |
< |
> |
= |
! |
& |
| |
{ |
} |
[ |
] |
( |
) |
~ |
. |
: |
` |
? |
, |
; |
' |
" |
-
A Log file called ImportPreferencesLog.txt is generated in the SmartPlant installation folder with success/failure messages.
-
For a complete list of domain project IDs, run the following SQL Query: SELECT * FROM Project.
Importing Access Rights for a Domain
Only available from Smart Instrumentation 13.1 HF 20 and higher.
Before using this command you must create an .accr file in the Administration module.
For more information, see Exporting and Importing Access Rights.
AccessRights
<Action>,<domain_username>,<domain_password>,<target_domain_name>,<target_group_name>,<target_project_name>,<file_path>
Example:
AccessRights IMPORT, John Smith, MyAdminPassword, MyTargetDomain, MyTargetGroup, MyTargetProject, C:\Downloads\MyAccessRights.accr
-
The Target_Project_Name cannot be left blank. If the Target Domain Name is an EPC domain, then the Target_Project_Name should be "As_Built". If the Target Domain Name is an As-Built domain, then the Project Name is used for the Target_Project_Name.
-
The Command Prompt window displays 0 or 1 when finished running the command.
0 = Success
1 = Failed
-
A Log file called AccessRights.log is generated in the SmartPlant installation folder with success/failure messages. In case of failure it is recommended to refer to the log file in order to see the failure reason.
For more information on using Silent mode (CLI or Batch (.bat) files), see Working with the Command Line Interface or Batch Files.
Importing Advanced Preferences
Only available from Smart Instrumentation 13.1 HF 23 and higher,
The CLI commands can only be used for importing Advanced and Default Preferences
saved as.apref files.
Importing to a Domain
ImportPreferences ADV,<DomainAdmin>,<DomainAdminPWD>,<path to apref>,<targetDomainName>
Example
ImportPreferences ADV, MyDomain,Abcd1234, D:\downloads\advancepref\MyAdvPrefFile.apref, DomainOne
Import to a Project
ImportPreferences ADV,<DomainAdmin>,<DomainAdminPWD>,<path to apref>,<targetDomainName>,<targetProjectName>
Example
ImportPreferences ADV, MyDomain,Abcd1234, D:\downloads\advancepref\MyAdvPrefFile.apref, DomainOne, Project2
A Log file called AdvancedPreferencesLog.log is generated in the SmartPlant installation folder with success/failure messages. In case of failure it is recommended to refer to the log file in order to see the failure reason.
For more information on using Silent mode (CLI or Batch (.bat) files), see Working with the Command Line Interface or Batch Files.