Submit a ticketCall us

Looking to compare latest NPM features with previous versions of NPM?
The NPM new feature summary offers a comparison of new features and improvements offered with this release.

 

Home > Success Center > Virtualization Manager (VMAN) > VMAN 7.1 Administrator Guide > Access Virtualization Manager through the PowerShell client > Syntax and usage of PowerCLI cmdlets

Syntax and usage of PowerCLI cmdlets

Table of contents
No headers
Created by Caroline Juszczak, last modified by MindTouch on Jun 23, 2016

Views: 4 Votes: 0 Revisions: 3
area cmdlet description syntax example
Basic session management Connect-H9Server Establishes a connection to the SolarWinds Virtualization Manager. This step is necessary before using any other cmdlets. Connect-H9Server [-Server] <String> [-User] <String> [-Password] <String> [<CommonParameters>] Connect-H9Server akutz-hyper9 admin admin
  Disconnect-H9Server Disconnects PowerCLI from the Virtualization Manager server. You must reconnect to the server before executing any further cmdlets. Disconnect-H9Server [<CommonParameters>] Disconnect-H9Server
Basic collection setup Get-H9Credentials Lists the existing credentials. The available credential types are VirtualCenter, Host, and WMI. Get-H9Credentials [-CType] <CredentialType> [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] Get-H9Credentials VirtualCenter
  Add-H9Credential Adds a credential set for data collection. The available credential types are VirtualCenter, Host, and WMI. Add-H9Credential [-Endpoint] <CredentialType> [-User] <String> [-Password] <String> [[-Domain] <String>] [[-Description] <String>] [<CommonParameters>] Add-H9Credential VirtualCenter admin Admin321 testDomain "Virtual Center On 192.168.1.150"
  Get-H9Collector Retrieves data collector instances. In a standard environment, there is only one collector. In a federated installation, there are several. Pair this command with the Add-H9Datasource cmdlet to associate new data sources with a specific collector. Get-H9Collector [<CommonParameters>] Get-H9Collector
  Add-H9Datasource Adds a server or Virtual Center to the list of targets Virtualization Manager can collect against. Add-H9Datasource [-Address] <String> [[-Description] <String>] [[-Collector] <Collector>] [[-Port] <Int32>] -UnmanagedHost -StartNow [<CommonParameters>] $col = Get-H9Collector

Add-H9Datasource 192.168.1.150 "Virtual Center on 192.168.1.150" $col[0] 443

Search and facet browsing Set-H9Query Sets or updates the active query. You can retrieve the items returned by the active query with the Get-H9Result cmdlet. The custom items are Virtual Machine, Host, Datastore, and Cluster. Set-H9Query [-Query] <String> [[-CiType] <String>] [<CommonParameters>] An active query for all VMs: Set-H9Query * VirtualMachine
  Get-H9Result Returns the configuration item references in the current active search. The configuration items are Virtual Machine, Host, Datastore, and Cluster. To modify the active search, use Set-H9Query. Get-H9Result [[-Start] <Int32>] [[-End] <Int32>] [<CommonParameters>] Query for configuration items from the active query with result numbers starting with 10 and ending with 20: Get-H9Result 10 20
  Get-H9Facet Retrieves a list of facets for the active query. If a facet path is specified, the cmdlet retrieves the values for those facets. Get-H9Facet [[-Path] <String>] [<CommonParameters>] Get-H9Facet
Active list integration Add-H9List Adds an item to the active list. You can retrieve the contents of the active list with the Show-H9List command. Add-H9List [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Adding all hosts to the active list: Set-H9Query *Hosts

Get-H9Result | Add-H9List

  Show-H9List Returns configuration item references for the contents of the active list. Show-H9List [<CommonParameters>] Show-H9List
  Set-H9List If a saved list of content objects is specified, the cmdlet loads the list into the active list. You can retrieve the contents of the active list with the Show-H9List command. Set-H9List [-List] <ConfigurationItemList> [<CommonParameters>] Loading a saved list, "VM 2008 list" to the active list: Get-H9Content SavedList "VM 2008 list" | Set-H9List
  Clear-H9List Removes all items from the active list. Clear-H9List [<CommonParameters>] Clear-H9List
Label management Set-H9Label Applies a label to a configuration item (Virtual Machine, Host, Datastore, or Cluster). If the label key already exists, the cmdlet overwrites the value for the target object. If the key does not exist, the cmdlet creates the key first. Set-H9Label [-Label] <String> [-Value] <String> [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Adding the "OS" label with the value "Windows" to the virtual machine called "Virtual Machine Test": Set-H9Query "Virtual Machine Test" VirtualMachine

$vm = Get-H9Result

Set-H9Label "OS" "Windows" $vm

  Get-H9Label Returns a list of labels and values for the specified configuration item (Virtual Machine, Host, Datastore, or Cluster) reference. Get-H9Label [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Retrieving the labels from virtual machines that are saved in the $vm variable: Get-H9label$vm
  Clear-H9Label Removes a label or all labels from a configuration item (Virtual Machine, Host, Datastore, or Cluster). Clear-H9Label [[-Label] <String>] [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Removing the label "OS" saved in the $vm variable from the virtual machine: Clear-H9Label "OS" $vm
Notes New-H9Note Creates a new note for the specified configuration item references (Virtual Machine, Host, Datastore, or Cluster). [-Text] <String> [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Adding the note "Testing note" to the virtual machine saved in the $vm variable: New-H9Note"Testing note" $vm
  Get-H9Note Retrieves notes for the specified configuration items (Virtual Machine, Host, Datastore, or Cluster). Get-H9Note [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Retrieving notes for the virtual machine saved in the $vm variable: Get-H9Note $vm
Document DNA Export-H9DNA Performs an on-demand DNA diff of two hosts, two VMs, or one host and VM over time. Export-H9DNA [-LeftCi] <ConfigurationItemReference> [-RightCi] <ConfigurationItemReference> [[-LeftDate] <DateTime>] [[-RightDate] <DateTime>] [<CommonParameters>] Retrieving the differences of two VMs saved in the $vm and $vm1 variables: Export-H9DNA$vm $vm1
Dependency graph browsing Get-H9Related Returns a list of related configuration items of the specified type (Virtual Machine, Host, Datastore, Cluster). The related types are the following:
  • 0: Virtual Machine
  • 1: Host
  • 2: Cluster
  • 3: Datastore
Get-H9Related [-RelatedType] <ConfigurationItemType> [-CiRef] <ConfigurationItemReference> [<CommonParameters>]
  • Retrieving the host where the virtual machine from the $vm variable is hosted: Get-H9Related1 $vm
  • Retrieving the list of VMs hosted by the host from the $hst variable: Get-H9Related 0 $hst
Retrieving and managing user content Get-H9Content Retrieves content items from SolarWinds Virtualization Manager (alerts, saved searches, lists, trends, and so on). Get-H9Content [[-WsType] <WorkspaceAssetType>] [[-Name] <String>] -OnlyMine [<CommonParameters>]

The Workspace Asset Types are the following:

  • 0: ExportTemplate
  • 1: ReportOutput
  • 2: SavedList
  • 3: SavedSearch
  • 4: Alert
  • 5: Trend
  • 6: Dashboard
  • 7: ResourceContainer
  • 8: ResourceUsageProfile
Retrieving the list of saved lists whose name includes the string "2008": Get-H9Content 2"2008"
  Set-H9Content Paired with the Get-H9Content cmdlet, this command makes changes to content stored by SolarWinds Virtualization Manager. Set-H9Content [-Asset] <AbstractWorkspaceAsset> [<CommonParameters>]  
  Remove-H9Content Removes content items from SolarWinds Virtualization Manager. Remove-H9Content [-Asset] <AbstractWorkspaceAsset> [<CommonParameters>]  
  Get-H9Report Given a ReportOutput content item, the cmdlet downloads the related report, using the [report name].[extension] format. The cmdlet writes the files to the current working directory. Get-H9Report [-Report] <ReportOutput> [<CommonParameters>]  
  Get-H9AlertRefs Retrieves configuration item references (Virtual Machine, Host, Datastore, or Cluster) associated with a currently firing alert. The command retrieves only the items associated with the most current execution of the alert. Get-H9AlertRefs [-Alert] <Alert> [<CommonParameters>] $alarm = Get-H9Content 4 "High VM Memory Utilization"

Get-H9Alertrefs $alarm

vSphere PowerCLI integration ConvertTo-H9Ref Converts a VI PowerCLI object to a SolarWinds Virtualization Manager item reference. The cmdlet works on virtual machines, hosts, clusters, data stores, and vapps. ConvertTo-H9Ref [-Target] <Object> [<CommonParameters>]  
Property Get-H9Property   Get-H9Property [-PropertyGroupName] <String> [-PropertyName] <String> [-Verbose] [-Debug] [ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [WarningVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>]  
  Set-H9Property   Set-H9Property [-PropertyGroupName] <String> [-PropertyName] <String> [-Value] <String> [-Verbose] [Debug] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>]  
Simple document management Get-H9Doc Retrieves shallow documents for the specified configuration item references. Shallow documents are documents which do not contain child documents. Get-H9Doc [-CiRef] <ConfigurationItemReference> [<CommonParameters>] Set-H9Query "Virtual Machine test" VirtualMachine

$vm = Get-H9Result

Get-H9doc $vm

  Get-H9History Retrieves all the configuration documents stored between the specified dates. Get-H9History [[-Start] <DateTime>] [[-End] <DateTime>] [[-CiRef] <ConfigurationItemReference>] [<CommonParameters>]  

 
Last modified
04:21, 23 Jun 2016

Tags

Classifications

Public