MicroStrategy ONE
Sample procedures
Command Manager contains a large number of sample procedures that you can view and modify. These procedures are briefly described below.
The sample procedures are stored in the Command Manager directory, in \Outlines\Procedure_Outlines\User_Procedures\. For instructions on how to view or edit a sample procedure, see Inserting sample statements: Outlines. For instructions on using procedures in your Command Manager scripts, see Procedures.
Add ACE on Folder Report
Add an Access Control Entry for the user 'userName' on the reports and folders in the folder 'folderName', which have been created 'numOfDays' days before today in the project 'projectName'.
Add Addresses to Multiple Users
For all users in the user group 'sUserGroup', create an email address consisting of the user name plus 'sWebAddress', which is the company web address or the Internet address for email, such as microstrategy.com.
Create DBLogin from File
Create a list of DBLogins from an input file 'sFileName'. The format for each line in the input file is
Create Facts
Create facts for all columns in the tables in the folder 'tablesFolder' for the project 'projectName'. The facts are created in the folder '
Create Users
Create users numbered 1 through 'NumberOfUsers' with the base
DBLogin All Properties
List all properties for every DBLogin associated with the current connection.
Delete Caches Except Some Reports
Delete all caches for the project 'projectName', except those for reports specified in 'reportNames'. The report names in '
Delete Caches Larger Than Specified Size
Delete all caches for the project 'sProject' that are larger than the specified size '
Delete Empty User Profiles
Locate and delete all empty user profiles in the project 'project'. An empty user profile is defined as a profile folder that has only empty folders inside.
Delete Folder Content Recursively
Recursively delete the contents of the folder 'folderName' in the path 'folderPath' for the project 'projectName'. This procedure does not delete subfolders of the folder or their subfolders.
Delete Folder Shortcuts
Delete all shortcuts to the folder 'folder' in the project 'project'. The parameter 'folder' is an absolute folder path.
Delete Report Caches by Creation Date
Delete all report caches in the project 'sProject' that were created '
Delete Report Caches by Expiration Date
Delete all report caches in the project 'sProject' that expire '
Delete Report Caches by Hit Counts
Delete all report caches in the project 'sProject' that have a hit count less than '
Delete Unlinked User Profiles
List all user profiles in project 'project', and delete all profile folders that are not linked to a user.
Delete Users in Group
List all members of a user group 'group' and delete all members of that group that are users.
Downgrade Privileges
Revoke all privileges of the 'categoryToRemove' privilege category. This procedure is useful in ensuring license compliance.
Grant Privileges to Users
Grant the Create Schema Objects privilege to all users in the group 'groupName'. You can easily modify this procedure to grant a different privilege.
Hide Search Results
Hide all the results returned by a search 'searchName' in the folder '
JDBC Example
This procedure demonstrates how to use JDBC in procedures. It is not usable until the JDBC environment has been configured, such as the database server, tables in the database, and login.
Kill User Jobs
Kill all low priority jobs belonging to user 'sUserName'
List All Attributes In Table
List all the attributes associated with the logical table 'sTable' in the project '
List All Attribute Expressions
List all attribute form names and their expressions for each attribute in the folder 'sFolderName' in the project '
List All DBInstances Mapped By a Project
List all the database instances associated with the project 'sProject'.
List All Facts in Table
List all facts associated with the logical table 'sTable' for the project '
List All Metrics Properties
List all properties for all metrics for the project 'sProject'.
List DBInstances for Projects
List all database instances for each loaded project.
List DBLogins with No Dependent
List all DBLogin objects that have no dependents.
List Disabled Users
Lists all users that have been disabled, that is, that cannot be used to log in to the system.
List Filters with No Dependent
List all filters in the folder 'folderName' for project 'projectName' that have no dependents.
List Groups And Security Role Associations
List all users and groups associated with each security role in the project 'sProject'.
List LDAP User or Group
List all users (if 'isForUser' is set to True) or groups (if '
List Nondefault Report VLDB Properties
List all reports that do not use default VLDB settings in the folder 'folder' for the project 'project', and the VLDB properties in those reports that do not use default settings.
List Parent User Groups
List all parent groups of a user group 'sGroup'.
List Projects That User Has Access To
List all projects that the user 'sUserName' has access to.
List Security Roles-Users-Projects Associations
List all the security roles and the users they are applied to for each project in the metadata.
List Specific Properties for All Tables
For all tables in the folder 'sFolder' in the project 'sProject', list the general properties such as Name, ID and Creation Time, as well as all attributes and facts associated with each table's logical view. You can easily modify this procedure to list a different set of properties.
Manipulate Warehouse MicroStrategy Accounts
Create or delete MicroStrategy users according to a database table. The file specified in 'configFile' defines the database connection and table schema information. The '
-
This procedure has been tested for Oracle databases. It may require modification to work with other DBMS types.
-
You must change the classpath for the database driver to load the correct the database driver.
Pattern Match
Find all DBInstances whose name contains the string input 'pattern'. This procedure demonstrates how to use basic pattern matching functionality in a procedure.
Recursively Delete All Reports Under a Folder
Delete all reports under the folder 'sTopFolder' in the project 'sProject', including reports in subfolders of that folder.
Recursively List All Users
List all users in a user group 'sTopUserGroup', including users in groups that are members of that group.
Recursively List Folders
List all folders in the folder 'sTopFolder' in the project 'sProject', including folders in subfolders of that folder.
Remove All ACE From Folder
Remove all Access Control Entries from the folder 'sFolderName' in the location 'sFolderPath' in the project 'sProject'.
Save and Reuse Project Configuration
Create a script that stores the project configuration settings for the project 'projectName'. This script can be used to recover the project configuration settings in the future. 'scriptFile' is the location where the script is saved.
Security Filters in Current Project for EveryoneGroup
List all the security filters that are present in the current project source, regardless of the project or user they are assigned to.
Security Filters in Tutorial for EveryoneGroup
List all the security filters for the project 'sProject' for every user.
Trigger Subscription for All Schedules
Trigger all subscriptions that are associated with a schedule in the project 'projectName'.
Unlinked DBConnections
List all DBConnections and DBLogins that are not linked to a DBInstance.
Update All Projects
Update all loaded projects to the latest metadata version. The input parameters are Boolean variables that indicate the update options to be used: 'onLanguage' for LANGUAGES, 'onSchedule' for SCHEDULES, 'isForced' for FORCE, and 'onMDXSrcObj' for MDXSOURCEOBJECTS.
Users Without Connection Maps
List all users who do not have any connection mappings and do not belong to any user group that has a connection mapping, in the project 'sProject'.
Users With Specific Privilege
List all users that have been granted the privilege 'sPrivilegeToken'.
Waiting For File In Folder
Every second, this procedure looks in the folder 'sFileDir' for script files. Any script files that appear in the folder are executed as soon as they appear. This procedure runs indefinitely, but can be easily modified to run a specific number of times.