-
Print
-
DarkLight
-
PDF
ControlUp Powershell Commands
-
Print
-
DarkLight
-
PDF
ControlUp supports a variety of commands to use in Powershell allowing users to run basic commands freely, both individually and in batches. The batch commands are preformed before one of the the other commands that support batch actions.
Each command in this article contains the synopsis of the command, full description and examples.
Review this blog article - Copy your AD OU Structure to ControlUp
These Powershell commands must be run from the ControlUp Monitor. First, you need to import the modules by running the following command:
$pathtomodule = (Get-ChildItem "C:\Program Files\Smart-X\ControlUpMonitor\*ControlUp.PowerShell.User.dll" -Recurse | Sort-Object LastWriteTime -Descending)[0]
Import-Module $pathtomodule
Commands
This section covers
Batch Related Commands These commands enable you to perform batch actions (where supported).
Computer Write Commands These actions enable you to perform writable actions to a specific computer or in batches.
Folder Get Commands
Folder Write Commands These actions enable you to perform writable actions to a specific folder or in batches.
Existing Computers. These actions enable you to view existing computers from the customer tree. These are 'read only' commandsת and are NOT available in batchesת as they are lists.
Sites Get Commands
New-CUBatchUpdate
NAME
New-CUBatchUpdate
SYNOPSIS
Performs batch updates for the computer and folder commands.
SYNTAX
New-CUBatchUpdate [<CommonParameters>]
DESCRIPTION
This command enables users to perform batch updates when it precedes another command that permits batch actions.
EXAMPLES
Example 1:
$b = New-CUBatchUpdate
Add-CUComputer -Name PC002 -Domain NTNET -FolderPath "\SQL Servers" -Batch $b
Add-CUComputer -Name PC003 -Domain NTNET -FolderPath "\SQL Servers" -Batch $b
Add-CUComputer -Name PC004 -Domain NTNET.local -DnsName PC004.SomeDNSName.com -FolderPath "\SQL Servers" -Batch $b
Publish-CUUpdates $b
This command adds three computer to the "\SQL Servers" folder path in the organizational tree. In the first two examples, computers "PC002" and "PC003" are in the domain "NTNET", and the third in the "NTNET.local" domain, with a distinct DNS name "PC004.SomeDNSName.com".
RELATED LINKS
Add-CUComputer
Publish-CUUpdates
NAME
Publish-CUUpdates
SYNOPSIS
Publishes updates to the computer and folder commands.
SYNTAX
Publish-CUUpdates [-Batch] <BatchUpdate> [<CommonParameters>]
DESCRIPTION
This command enables users to publish batch updates when it precedes another command that permits batch actions.
EXAMPLES
Example 1:
$b = New-CUBatchUpdate
Get-CUComputers -FolderPath “\SQL Servers” -Match SQLSRV | Remove-CUComputer -Batch $b
Publish-CUUpdates $bName
This command removes all computers from the folder path "\SQL Servers" that match the name "SQLSRV".
Example 2:
$b = New-CUBatchUpdate
Search-CUComputersFromAD -Domain NTNET -Name *SQLSRV* | Add-CUComputer -FolderPath “\SQL Servers” -Batch $b
Publish-CUUpdates $b
The command searches for computers in the NTNET domain that contain "SQLSRV". In the organizational tree, these computers are added to the "\SQLServers" folder path.
Show-CUBatchResult
NAME
Show-CUBatchResult
SYNOPSIS
Shows batch results for the performed computer and folder commands.
SYNTAX
Show-CUBatchResult [-Batch] <BatchUpdate> [[-ShowSuccess]] [<CommonParameters>]
DESCRIPTION
This command enables users to show results for batch actions performed when it precedes another command that permits batch actions.
EXAMPLES
Example 1:
Show-CUBatchResult Remove-CUFolder -FolderPath 'CUFolder' -ParentPath 'Organization Name'
This command shows the successful/failed attempts to remove multiple folders.
Add-CUComputer
NAME
Add-CUComputer
SYNOPSIS
Adds a computer to ControlUp Real-Time Console.
SYNTAX
Add-CUComputer [-Name] <string> [-Domain] <string> [[-FolderPath] <string>] [[-DnsName] <string>] [[-SiteId] <string>] [[-Description] <string>] [[-Batch] <BatchUpdate>] [<CommonParameters>]
DESCRIPTION
Adds a computer account from Active Directory to ControlUp Real-Time Console.
ADComputerName describes the computer account name as appears in Active Directory.
DomainName describes the domain name from which the computer will be added.
FolderPath describes the ControlUp folder path to which the computer will be added.
This action can be performed in batches.
PARAMETERS
-ADComputerName
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
-DomainName
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
-FolderPath
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
EXAMPLES
Example 1:
Add-CUComputer -ADComputerName 'PC001' -DomainName 'NTNET' -FolderPath '\SQL Servers'
RELATED LINKS
Remove-CUComputer
Remove-CUComputer
NAME
Remove-CUComputer
SYNOPSIS
Removes a computer from ControlUp Real-Time Console.
SYNTAX
Remove-CUComputer [-Name] <string> [[-Force]] [[-Batch] <BatchUpdate>] [<CommonParameters>]
DESCRIPTION
Removes a computer from ControlUp real-time Console.
Name indicates the computer to be removed from ControlUp real-time Console and can be entered as it appears in ControlUp, as an FQDN or as an IP address.
PARAMETERS
-Name
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
EXAMPLES
Example 1:
Remove-CUComputer -Name 'John-PC'
Example 2:
Remove-CUComputer -Name '117.34.2.7'
RELATED LINKS
Add-CUComputer
Move-CUComputer
NAME
Move-CUComputer
SYNOPSIS
Moves a computer between ControlUp folders.
SYNTAX
Move-CUComputer [-Name] <string> [-FolderPath] <string> [[-Force]] [[-Id] <string>] [[-Batch] <BatchUpdate>] [<CommonParameters>]
DESCRIPTION
Moves a computer between ControlUp folders.
This indicates the computer to be moved from current location to -NewFolderPath which determines the new location in ControlUp Real-Time Console.
The name can be entered as it appears in ControlUp, as an FQDN or as an IP address.
This action can be performed in batches.
PARAMETERS
-Name
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
EXAMPLES
Move-CUComputer -Name 'John-PC' -NewFolderPath '\Servers\Boston'
Add-CUFolder
NAME
Add-CUFolder
SYNOPSIS
Adds a folder to the console.
SYNTAX
Add-CUFolder [-Name] <string> [[-ParentPath] <string>] [[-Description] <string>] [[-ExcludeFromMonitor] <bool>] [[-Batch] <BatchUpdate>] [<CommonParameters>]
DESCRIPTION
Adds a folder to the ControlUp real-time Console. The folder name is specified by the -Name parameter, and its parent location by the -ParentPath parameter. If -ParentPath is not specified, the new folder is created under the root folder.
Optional parameters - ExcludeFromMonitor determines whether the folder contents are to be excluded from connection by ControlUp Monitor services. If this parameter is not specified, its values are inherited from the parent folder.
PARAMETERS
-Name
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
-ParentPath
Required | false |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
-Description
Required | false |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
-ExcludeFromMonitor
Required | false |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
EXAMPLES
Example 1:
Add-CUFolder -Name 'SQL Servers'
Creates a folder named SQL Servers under the organization root folder.
Example 2:
Add-CUFolder -Name 'Production' -ParentPath 'Organization Name\SQL Servers'
Creates a folder named “Production” under the SQL Servers folder.
Example 3:
Add-CUFolder -Name 'Test' -ParentPath 'Organization Name\SQL Servers' -Description 'Test SQL Servers' -ExcludeFromMonitor $true
Creates a folder named “Test” under the SQL Servers folder with the specified description, and instructs ControlUp to exclude this folder from monitor connections.
RELATED LINKS
Remove-CUFolder
REMARKS
The following characters are allowed: letters, numbers, space, dash and underscore.
The following folder names are reserved and cannot be used: “Hypervisors”, “Cloud Connections”, “CVAD Sites”.
Get-CUFolders
Lists all folders in the ControlUp organization tree.
Remove-CUFolder
NAME
Remove-CUFolder
SYNOPSIS
Removes a folder from the ControlUp Real-Time Console.
SYNTAX
Remove-CUFolder [-FolderPath] <string> [[-Force]] [[-Batch] <BatchUpdate>] [<CommonParameters>]
DESCRIPTION
Removes a folder from the console. Folder path is specified by the -FolderPath parameter.
Optional parameter - Force ignores any validation questions.
This action can be performed in batches.
PARAMETERS
-FolderPath
Required | true |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
-Force
Required | false |
Position | Named |
Accept pipeline input | false |
Parameter set name | (All) |
Aliases | None |
Dynamic | false |
EXAMPLES
Example 1:
Remove-CUFolder -FolderPath 'MyFirstCUFolder' -ParentPath “Organization Name”
Example 2:
Remove-CUFolder -FolderPath 'MySecondCUFolder' -ParentPath “Organization Name\XD Folders”
Example 3:
Remove-CUFolder -FolderPath 'MyThirsCUFolder' -ParentPath “Organization Name” -Force True
RELATED LINKS
Add-CUFolder
Get-CUComputers
NAME
Get-CUComputers
SYNOPSIS
Creates a list of ControlUp computers in the organization configuration.
SYNTAX
Get-CUComputers [[-FolderPath] <string>] [[-Match] <string>] [<CommonParameters>]
DESCRIPTION
Get the configured ControlUp windows agents. Optional parameters are for getting the computers under a folder subtree using the -FolderPath option, and using the -Match for limiting the results using a regex filter.
REMARKS
To see the examples, type: "get-help Get-CUComputers -examples"
For more information, type: "get-help Get-CUComputers -detailed"
For technical information, type: "get-help Get-CUComputers -full"
Search-CUComputersFromAD
NAME
Search-CUComputersFromAD
SYNOPSIS
Queries the Active Directory for computers that can be added to ControlUp.
SYNTAX
Search-CUComputersFromAD [-Name] <string> [-Domain] <string> [[-OU] <string>] [<CommonParameters>]
DESCRIPTION
Searches the Active Directory for computers with the attributes ControlUp requires (Netbios and dnsHostName). You can pipe the result set to Add-CUComputer
(use batch when adding a large number of computers).
The name is the search string for the computer name. Wildcard characters are supported.
The domain is the FQDN or NetBIOS name for the AD domain. ControlUp must be configured for this domain.
OUs are optional and allow for limiting search results.
REMARKS
To see the examples, type: "get-help Search-CUComputersFromAD -examples"
For more information, type: "get-help Search-CUComputersFromAD -detailed"
For technical information, type: "get-help Search-CUComputersFromAD -full"
Get-CUSites
Returns all ControlUp sites in your ControlUp environment.