Model, Component, and Package Management > Model management > Model Explorer > Command line interface - ScfUtils > Overview of command line interface for Model Explorer functions (Model Explorer)
Overview of command line interface for Model Explorer functions (Model Explorer)
You can perform the following Model Explorer functions through the ScfUtils command line interface:
Initializing databases.
Bookmarking databases.
Starting and stopping databases.
Listing all available databases.
Listing database groups, users, and active users.
Deleting a database.
Backing up a database.
Restoring a database.
Adding a profile.
Optimizing databases.
Clearing locks.
Creating server logins and changing roles for users and groups.
Managing principals (adding or deleting principals and changing principal roles).
Synchronizing a database with Active Directory group changes.
Synchronizing users and groups.
Transferring access permissions.
Finding and optionally deleting orphaned items.
Exporting and importing Models.
Creating and deleting Models.
Cloning and versioning Models.
Protecting and unprotecting Models.
Branching, rebasing and reconciling Models.
Getting and setting the model comment.
If a ScfUtils command succeeds, 0 is returned, else 1 is returned.
If you run ScfUtils with a -h parameter, a summary of the ScfUtils commands is listed.
* 
In each case, the <server>, <database> and <model> names are case sensitive.
If you have installed Modeler to the default locations, ScfUtils resides in the following location:
C:\Program Files (x86)\PTC Integrity Modeler\Modeler\Exe\SCFUtils.exe
You can perform the following functions with the ScfUtils command.
To initialize a database
ScfUtils -init Enterprise "\\SQL\<server>@<instance>\<database>"
To bookmark a database:
For more information refer to Mapping a Database through ScfUtils
ScfUtils -map Enterprise \\SQL\<server>@<instance>\<database>"
To start or stop a database:
ScfUtils -startdb Enterprise \\SQL\<server>@<instance>\<database>"
ScfUtils -stopdb Enterprise \\SQL\<server>@<instance>\<database>"
To list all available databases
ScfUtils -listdb Enterprise \\SQL\<server>@<instance>\<database>\<instance-name>"
To list all groups, users, and active users in a database
Listing users in a database:
ScfUtils -listdbusers Enterprise "<database-ref>"
Listing groups in a database:
ScfUtils -listdbgroups Enterprise "<database-ref>"
Listing active users in a database:
ScfUtils -listdbactiveusers Enterprise "<database-ref>"
To clear locks in a database
For more information, refer to Clearing locks in a database through ScfUtils.
Clearing all locks:
ScfUtils -clearalllocks Enterprise "<database-ref>"
Clearing locks for a specific user:
ScfUtils -clearuserlocks Enterprise "<database-ref>" "<user>"
To delete a database
ScfUtils -deletedb Enterprise "<database-ref>"
To backup a database
For more information, refer to Backing up a database through ScfUtils.
ScfUtils -backupdb Enterprise "<database-ref>" "<backup-location>" [-T]
To restore a database
ScfUtils -restoredb Enterprise "<instance-name>" "<backup-file>"
To synchronize a database with Active Directory group changes
ScfUtils -syncall Enterprise "<database-ref>"
To synchronize user and group permissions in a database
For more information, refer to Synchronizing users and groups through ScfUtils.
Synchronizing user permissions:
ScfUtils -syncuser Enterprise "<database-ref>" "<user>"
Synchronizing group permissions:
ScfUtils -syncgroup Enterprise "<database-ref>" "<group name>"
To transfer access permissions
ScfUtils -transferpermissions Enterprise "<database-ref>" "<from>" "<to>"
To add a profile
For more information, refer to Adding a profile through ScfUtils.
ScfUtils -addprofile Enterprise "\\SQL\<server>@<instance>\<database>\<model>" "<profile-id>"
To optimize a database
For more information, refer to Optimizing a database through ScfUtils.
ScfUtils -optimizedb Enterprise "<database-ref>"
To create server logins and change roles for users and groups
Creating a server login:
ScfUtils -createlogin Enterprise "<instance-name>" "<user/group>" "<isAdmin>"
Changing roles for users and groups:
ScfUtils -changeloginrole Enterprise "<instance-name>" "<user/group>" "<isAdmin>"
To manage principals (add/delete principals, change principal role)
For more information, refer Managing principals.
Adding a principal:
ScfUtils -addprincipal Enterprise "<database-ref>" "<user/group>" "<isAdmin>"
Changing a principal role:
ScfUtils -changeprincipalrole Enterprise "<database-ref>" "<user/group>" "<isAdmin>"
Deleting a principal:
ScfUtils -deleteprincipal Enterprise "<database-ref>" "<user/group>"
To branch a model:
For more information refer to Branching a Model through ScfUtils
ScfUtils -sandboxmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To clone a model:
For more information refer to Cloning a Model through ScfUtils
ScfUtils -clonemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<new model name>" <retain permissions 1 or 0> [\\SQL\<server>@<instance>\<database>"]
To create a model:
For more information refer to Creating a Model through ScfUtils
ScfUtils -addmodel Enterprise \\SQL\<server>@<instance>\<database>" "<new model name>"
To create a replica:
For more information refer to Creating a replica through command line
createreplica Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" -d -f "<folder containing exported files>"
To delete a model:
For more information refer to Deleting a model through ScfUtils
ScfUtils -deletemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To difference a model or package:
Syntax is dependent on which difference operation is being performed.
To export a model:
For more information refer to Exporting a model through ScfUtils
ScfUtils -exportmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<directory>"
To find and optionally delete orphaned items
ScfUtils -findorphans Enterprise \\SQL\<server>@<instance>\<database>" [-D]
To generate a model branch report:
For more information refer to Generating a model branch report
ScfUtils -getmodelbranchreport Enterprise \\SQL\<server>@<instance>\<database>" "<file path and name>"
To generate a model family report:
For more information refer to Generating a model family report
ScfUtils -getmodelfamilyreport Enterprise \\SQL\<server>@<instance>\<database>" "<file path and name>"
To get a model's comment:
ScfUtils -getmodelcomment Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<path and file name>"
To import a model (Unzipped):
For more information refer to Importing a model through ScfUtils
ScfUtils -importmodel Enterprise \\SQL\<server>@<instance>\<database>" "<directory>"
To import a model (Zipped):
For more information refer to Importing a zipped model through ScfUtils
ScfUtils -importzippedmodel Enterprise \\SQL\<server>@<instance>\<database>" "<zip file>"
To rebase a model:
For more information refer to Rebasing a model through ScfUtils
ScfUtils -rebasemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<path and name of log file>"
To reconcile a branch to the trunk
ScfUtils -reconcilemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<path and name of log file>"
To reconcile a branch to another branch:
ScfUtils - mergesandboxes Enterprise "\\SQL\<source server>\<source database>\<source model>\<source version>" "\\SQL\<target server>\<target database>\<target model>\<target version>" "<log file>" [-X]
To remove a bookmark from a database:
For more information refer to Unmapping a database through ScfUtils
ScfUtils -unmap Enterprise \\SQL\<server>@<instance>\<database>"
To rename a model:
For more information refer to Renaming a model through ScfUtils
ScfUtils -renamemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<new model name>"
To set a model's comment:
ScfUtils -setmodelcomment Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<text>"
To protect a model:
For more information refer to Protect a model through ScfUtils
ScfUtils -protectmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To unprotect a model:
For more information refer to Unprotect a model through ScfUtils
ScfUtils -unprotectmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To update all PTC profiles in a model:
ScfUtils -updateallprofiles Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" [-B] [-A]
To upgrade a model:
For more information refer to Upgrading a database through ScfUtils
ScfUtils -upgrade Enterprise \\SQL\<server>@<instance>\<database>"
To version a model:
For more information refer to Version a model through ScfUtils
ScfUtils -versionmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"