TABLE OF CONTENTS
User-Defined Buttons
User-defined buttons allow you to add custom actions to the main grid views of the Applications, Users, Devices, Deployment Units, and Bespoke modules. These buttons can run PowerShell scripts, initiate ESM Plans, send emails, or execute built-in actions via the ManagementStudio API. User-defined buttons are accessed from the right-click context menu on the grid. Sub-buttons can be added to organise complex actions and improve usability.
Note: The primary (top-level) button on the context menu is a container and cannot execute actions. At least one sub-button must be configured to perform an action.
Example - Custom Buttons added to Grid Context Menu

Button Types
User-defined buttons support several action types. Each button can only perform one type of action.
- Script Buttons: Pass selected grid items (such as Applications or Users) to a PowerShell script.
- ESM Plan Buttons: Pass selected items to an ESM Plan for processing.
- Send Email Buttons: Send emails to selected items using designated templates.
- Action Buttons: Invoke built-in actions on selected items.
Limitation: A single button cannot perform multiple action types (e.g., execute a PowerShell script and run an ESM Plan); one action type per button is enforced.
Script Buttons
Script buttons execute pre-registered PowerShell scripts configured in the Administration → PowerShell Scripts area. You can prompt users for input before running the script. Input is passed as variables to the script for flexible automation.
User Input Options
When creating a script button, you can request input from the user with several configurable input types:
| Input Type | Description | Control Args |
|---|---|---|
| Text - Single Line | User enters a single line of text | None |
| Multi-Line | User enters a block of text | MaxLines:5; |
| Date and Time | User selects date and time | MaxDate:YYYY-MM-DD; MinDate:[Today-1]; |
| Date Only | User selects a date | MaxDate:YYYY-MM-DD; MinDate:[Today-1]; |
| Time Only | User selects a time | MinHour:HH; MaxHour:HH; Interval:HalfHour; |
| Checkbox | User selects TRUE/FALSE (default: FALSE) | None |
| Integer | User enters a whole number | MaxValue:50; MinValue:0; |
| Decimal | User enters a decimal number | MaxValue:50; MinValue:0; |
| Dropdown | User selects a single item from a list | Items:Option1|Option2|Option3 |
| Listbox | User can select multiple items from a list | Items:Option1|Option2|Option3 |
| Module Items | User selects items from any supported module | Module:ModuleName; Multiple;Valid Module values: Applications, UserMigrations, Devices, Mailboxes, BespokeModule, DeploymentUnits, Dashboard, Defects, TasksAdding Multiple allows multi-selection. |
Example user input configuration:
Dropdown: Items:AD Group1|AD Group 2|AD Group3
Date Only: MaxDate:2024-01-01;MinDate:[Today-1]
Integer: MaxValue:50;MinValue:0;
ESM Plan Buttons
ESM Plan buttons initiate automated processing on selected grid items by running a configured ESM Plan. To assign an ESM Plan to a button, select the desired plan from the Run ESM Plan column in the Button UI Grid.
Key Points:
- Only ESM Plans targeting the current module (e.g., Applications) will appear in the dropdown.
- Each button can be linked to a single ESM Plan.
UI Buttons Grid Columns
User-defined buttons are managed in a setup grid with sections for Button configuration, Options, and Actions. The following table describes each field:
| Column | Description |
|---|---|
| Button Label | The displayed label in the context menu. Sub-buttons are shown as nested entries. |
| Sub-Button | Add a sub-button by clicking the plus icon next to the label. Supports multiple nesting levels for creating menu hierarchies. |
| Is Enabled | Controls whether the button is presented in the context menu. If unticked, the button is hidden. |
| Icon | Font Awesome Pro icon name for display (e.g., bullseye-pointer). |
| Grant Access 1/2/3 | Assigns role groups allowed to use the button. Buttons appear only for users in these role groups. Different buttons can have different access rules. |
| Order | Determines the sequence of buttons and sub-buttons in the menu. |
| Context Menu | When enabled, the button is accessible from the right-click context menu. |
| Are You Sure | If enabled, prompts the user for confirmation before running the action (script, ESM Plan, or email). |
| UI Wait Complete | (Hidden) Puts the grid view into a busy state until the script completes. Use for short scripts to trigger a UI refresh upon completion. Long-running scripts should not enable this to avoid UI lockup; users receive a notification when the script finishes. |
| Limit | (Hidden) Maximum number of grid items the button can process at once. 0 indicates no limit. Useful for restricting long-running or high-risk scripts. |
| Script User Input | Adds a user input prompt (Textbox, Number Picker, Date Picker). Input is passed to the script as the UserInput variable. |
| User Input Label | Label for the above input control. |
| User Input Control Args | Modifiers for setting limits and options on the user input control. See input type details above. |
| Running Msg to User | (Hidden) Text displayed in the alert bar when the button is triggered. |
| Run ESM Plan | Assigns the ESM Plan to execute when the button is used. |
| Run Script | Selects which PowerShell script to run (script must be registered under Administration → PowerShell Scripts for the relevant module). |
| Send Email | Selects the email template to use (template must be defined under Administration → [module] → Email Templates). |
| Args 1/2/3 | (Hidden) Custom arguments passed to the script; useful for reusing scripts across multiple buttons with different behaviours. |
| Delete | Marks the button for deletion upon next save. |
| Id | Internal identifier for the button. |
| Parent Id | (Hidden) References the parent button if this is a sub-button; used for maintaining menu hierarchy and scripting logic. |
Note: Hidden columns can be accessed using the column chooser button at the top right of the grid.
Further Support
For additional assistance, visit the ManagementStudio Service Desk to search the knowledge base or submit a support ticket.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article