Integration
Table Of Contents
- View Integration
- Contents
- View Integration
- Introduction to View Integration
- Integrating View with the Event Database
- Using View PowerCLI
- Getting Started with View PowerCLI
- View Administrator, View PowerCLI, and vdmadmin Compared
- View PowerCLI cmdlet Reference
- View PowerCLI cmdlet Parameters
- Examples of Using View PowerCLI cmdlets
- Managing View Connection Server Instances
- Managing vCenter Server Instances in View
- Managing Desktop Pools
- Creating and Updating Automatically Provisioned Desktop Pools
- Creating and Updating Linked-Clone Desktop Pools
- Creating and Updating Manually Provisioned Desktop Pools
- Creating and Updating Manual Unmanaged Desktop Pools
- Displaying Information About Users and Groups
- Managing Desktop Entitlements
- Managing Remote Sessions
- Managing Virtual Machines
- Displaying Information About Physical Machines
- Updating Virtual Machine Ownership
- Displaying Event Reports
- Displaying and Updating Global Settings
- Displaying and Adding License Keys
- Examples of Using View PowerCLI to Perform Advanced Tasks
- Assigning Multiple Network Labels to a Desktop Pool
- Network Label Configuration File Format
- Example Network Label Configuration File
- Obtain and Export NIC and Network Label Information
- Verify and Edit a Network Label Configuration File
- Deploy a Desktop Pool That Uses Multiple Network Labels
- Displaying Network Label Assignments for a Pool
- Displaying Network Label Assignments for a Virtual Machine
- Displaying vCenter Server Network Label Assignments for a Virtual Machine
- Disable Automatic Network Label Assignments
- Customizing LDAP Data
- Integrating View with Microsoft SCOM
- Setting Up a SCOM Integration
- Assign a Name to the View Connection Server Group
- View Management Packs
- Import the View Management Packs on the SCOM Server
- Enable a Proxy Agent on a View Connection Server Host or Security Server
- Run the Discovery Script in the Operations Manager Console
- View Connection Server and Security Server Managed Objects
- View Object Classes and Relationships
- Monitoring View in the Operations Manager Console
- Setting Up a SCOM Integration
- Examining PCoIP Session Statistics with WMI
- Setting Desktop Policies with Start Session Scripts
- Index
# If a pool is using all its desktops, increase its maximum size
# or output a warning if it cannot be resized.
if($maxdesktops -eq $remotecount){
if($Pool.deliveryModel -eq "Provisioned"){ # Pool type can be resized
$newmaximum = [int]$Pool.maximumCount + [int]$increment
if($Pool.desktopSource -eq "VC"){ # Resize an automatic pool
Update-AutomaticPool -pool_id $Pool.pool_id -maximumCount $newmaximum
} elseif ($Pool.desktopSource -eq "SVI"){ # Resize a linked-clone pool
Update-AutomaticLinkedClonePool -pool_id $Pool.pool_id -maximumCount $newmaximum
}
Write-Output ("Pool " + $Pool.pool_id + " is using 100% of its desktops. Maximum VMs
increased to " + $newmaximum)
} else { # Pool type cannot be resized
Write-Output ("Pool " + $Pool.pool_id + " is using 100% of its desktops. Consider
increasing its capacity.")
}
}
}
Determining Paths to vSphere Inventory Objects
The following PowerShell function uses vSphere PowerCLI to return the full path to a vSphere inventory
object.
# VVGetInventoryPath
# Parameters
# $InvObject Inventory object in vSphere PowerCLI.
#
# Examples
# VVGetInventoryPath (Get-VM -name myVM)
# VVGetInventoryPath (Get-ResourcePool | Select -first 1)
function VVGetPath($InvObject){
if($InvObject){
$objectType = $InvObject.GetType().Name
$objectBaseType = $InvObject.GetType().BaseType.Name
if($objectType.Contains("DatastoreImpl")){
Write-Error "Use the VVGetDataStorePath function to determine datastore paths."
break
}
if(-not ($objectBaseType.Contains("InventoryItemImpl") -or
$objectBaseType.Contains("FolderImpl") -or
$objectBaseType.Contains("DatacenterImpl") -or
$objectBaseType.Contains("VMHostImpl") ) ){
Write-Error ("The provided object is not an expected vSphere object type. Object type
is " + $objectType)
break
}
$path = ""
# Recursively move up through the inventory hierarchy by parent or folder.
if($InvObject.ParentId){
$path = VVGetPath(Get-Inventory -Id $InvObject.ParentId)
} elseif ($InvObject.FolderId){
Chapter 3 Using View PowerCLI
VMware, Inc. 47