VMware PowerCLI User's Guide
VMware PowerCLI User's Guide
Updated Information
Introduction to VMware PowerCLI
Microsoft PowerShell Basics
PowerShell Command-Line Syntax
PowerShell Pipelines
PowerShell Wildcards
PowerShell Common Parameters
PowerCLI Concepts
PowerCLI Modules
Retrieving vSphere Inventory Objects from Cloud Resources
Selecting Objects in PowerCLI
Processing Non-alphanumeric Characters in PowerCLI
Running PowerCLI Cmdlets Asynchronously
Managing Default Server Connections in PowerCLI
Customization Specification Objects in PowerCLI
Using ESXCLI with PowerCLI
Using the PowerCLI About Articles
Installing VMware PowerCLI
Supported Operating Systems
Supported VMware Products
Supported PowerShell Versions
Install PowerCLI
Install PowerCLI Offline
Update PowerCLI
Uninstall PowerCLI
Configuring VMware PowerCLI
Allow Execution of Local Scripts
Configuring PowerCLI Response to Untrusted Certificates
Configure the PowerCLI Response to Untrusted Certificates
PowerCLI Trusted Certificate Store
Modify the Timeout Setting for Web Tasks
Scoped Settings of vSphere PowerCLI
Configuring the Scope of the PowerCLI Settings
Priority of Settings Scopes in PowerCLI
PowerCLI Configuration Files
Installing and Configuring Python for PowerCLI
Install and Configure Python on Windows
Install and Configure Python on macOS
Install and Configure Python on Linux
Configuring Customer Experience Improvement Program
VMware Customer Experience Improvement Program
Join the Customer Experience Improvement Program in PowerCLI
Managing vSphere with VMware PowerCLI
Connecting to a vCenter Server System
Connect to a vCenter Server System
Connect to an AD FS - Federated vCenter Server System
Create vSphere Inventory Objects
vCenter Server and Host Management
Get a List of Hosts on a vCenter Server System and View Their Properties
Add a Standalone Host to a vCenter Server System
Set the License Key for a Host on vCenter Server
Activate Maintenance Mode for a Host on vCenter Server
Change the Host Advanced Configuration Settings on vCenter Server
Create a Host Profile on a vCenter Server System
Apply a Host Profile to a Host on vCenter Server
Create a vSphere Role and Assign Permissions to a User
Modify the vCenter Server Email Configuration
Modify the vCenter Server SNMP Configuration
Compute Cluster Administration
Create and Modify Advanced Settings for a Cluster
Create a New VM-VM DRS Rule
Create a New VM-VMHost DRS Rule
Virtual Machine Administration
Manage Virtual Machines on vSphere
Create Virtual Machines on vCenter Server Using an XML Specification File
Manage Virtual Machine Templates on vCenter Server
Create and Use Snapshots on vCenter Server
Update the Resource Configuration Settings of a Virtual Machine on vCenter Server
Move a Virtual Machine to a Different Host Using VMware vSphere vMotion
Move a Virtual Machine to a Different Datastore Using VMware vSphere Storage vMotion
Move a Virtual Machine to a Different vCenter Server System
Add Passthrough Devices to a Host and Virtual Machine
Apply a Customization Object to a Cloned Virtual Machine
Modify the Default NIC Mapping Object of a Customization Specification
Modify Multiple NIC Mapping Objects of a Customization Specification
Create Multiple Virtual Machines that Use Static IP Addresses
Create Multiple Virtual Machines with Two Network Adapters
vSphere vApp Administration
Create a vApp on vCenter Server
Modify the Properties of a vApp
Export or Import vApps
Using Tags
Retrieve a Tag and Save It into a Variable
Retrieve a Tag Category and Save It into a Variable
Create a Tag Category and a Tag
Assign a Tag to Virtual Machines
Retrieve Objects by Tag
Generate Tags Automatically by Using a Script
Add an Entity Type to a Tag Category
Retrieve Tag Assignments
Using Content Libraries
Create a Local Content Library
Create a Subscribed Content Library
Create a Content Library Item
Create a Virtual Machine from a Content Library Item
Create a vApp from a Content Library Item
Export Content Library Item's Files to a Local Machine
vSphere Networking
Modify the Settings of the NIC Teaming Policy for a Virtual Switch
Network Management with vSphere Distributed Switches
Create a Distributed Switch and Configure Networking
Configure a Distributed Switch
Migrate Virtual Machine Networking Configuration from a vSphere Standard Switch to a vSphere Distributed Switch
Migrate Physical and Virtual NICs to a vSphere Standard Switch
Migrate Physical and Virtual NICs to a vSphere Distributed Switch
Configure the Traffic Shaping Policy
Configure the Security Policy
vSphere Storage
Create an iSCSI Host Storage
Storage Policy Based Management with VMware PowerCLI
Create a Tag-Based Storage Policy
Create a Capability-Based Storage Policy
Associate a Storage Policy with a Virtual Machine and Its Hard Disk
Disassociate a Storage Policy Associated with a Virtual Machine and Its Hard Disk
Remove a Storage Policy
Edit a Storage Policy
Export and Import a Storage Policy
Create a Virtual Machine in a Datastore Compatible with Storage Policy
Add a VASA Provider and Create a Policy
Invoke a Planned Failover on a Replication Group and Reverse the Replication
Attach a Flat VDisk to a Virtual Machine
Create an NFS 4.1 Datastore
Managing Certificates
Add a Root Certificate to vCenter Server and ESXi
Change the Machine SSL Certificate of vCenter Server
Change the Machine SSL Certificate of an ESXi Host
Using Get-View
Filter vSphere Objects with Get-View
Populate a View Object with Get-View
Update the State of a Server-Side Object
Reboot a Host with Get-View
Modify the CPU Levels of a Virtual Machine with Get–View and Get–VIObjectByVIView
Creating Custom Properties
Create a Custom Property Based on an Extension Data Property
Create a Script-Based Custom Property for a vSphere Object
Using the PowerCLI Inventory Provider
Browse the Default Inventory Drive
Create a New Custom Inventory Drive
Manage Inventory Objects Through Inventory Drives
Using the PowerCLI Datastore Provider
Browse the Default Datastore Drives
Create a New Custom Datastore Drive
Manage Datastores Through Datastore Drives
Managing vSphere Update Manager with VMware PowerCLI
Create Patch Baselines
Attach and Detach Baselines
Scan a Virtual Machine
Check Virtual Machine Baseline Status
Stage Patches
Remediate a Virtual Machine
Upgrade Virtual Machine Hardware
Remediate a Cluster
Remediate a Host
Download Patches and Scan Objects
Managing vSphere Lifecycle Manager with VMware PowerCLI
Understanding vSphere Lifecycle Manager
Creating and Managing vSphere Lifecycle Manager Clusters with PowerCLI
Sample Scripts for vSphere Lifecycle Manager Cluster-Level Operations
Managing vSphere Lifecycle Manager Standalone Hosts with PowerCLI
Sample Scripts for vSphere Lifecycle Manager Host-Level Operations
vSphere Monitoring and Performance
Use Esxtop to Get Information on the Virtual CPUs of a Virtual Machine
Manage Statistics and Statistics Intervals on vCenter Server
Alarm Management
View Actions and Triggers for an Alarm on vCenter Server
Create Alarm Definitions on vCenter Server
Modify Alarm Definitions on vCenter Server
Create Alarm Actions and Triggers on vCenter Server
Remove Alarm Definitions and Actions
Managing the vSphere Automation API with VMware PowerCLI
Understanding the vSphere Automation SDK for PowerShell
Navigating the vSphere Automation SDK for PowerShell
Connecting to a vSphere Automation API Server
Connect Through Connect-VIServer
Connect Through a Configuration Object
Managing vCenter Server Connections Through Configuration Objects
Create a Local User Account in vCenter Server
Update the Local Accounts Global Password Policy in vCenter Server
Create a Virtual Machine
Create Tag Category, Tag, and Tag Association
Create Content Library and Content Library Item
Managing VMware vSAN with VMware PowerCLI
Create a vSAN Datastore
Modify a vSAN Datastore
Create a vSAN Stretched Cluster
Enable a vSAN File Service
Create a vSAN File Service Domain
Create a vSAN File Share
Create a vSAN ESA-Enabled Cluster
Mount and Unmount Remote vSAN Datastores
Managing the vSphere Replication API with VMware PowerCLI
Understanding the vSphere Replication SDK for PowerShell
Navigating the vSphere Replication SDK for PowerShell
Connect to a Local vSphere Replication Server
Connect to a Local and to a Remote vSphere Replication Server
Use the ConnectedPairings Property
Replicate a VM to a Datastore on the Local vCenter Server System
Replicate a VM to a Datastore on a Remote vCenter Server System
Managing VMware Site Recovery Manager (SRM) with VMware PowerCLI
Connect to an SRM Server
Protect a Virtual Machine
Create a Report of the Protected Virtual Machines
Create a Report of the Virtual Machines Associated with All Protection Groups
Managing the Site Recovery Manager (SRM) API with VMware PowerCLI
Understanding the Site Recovery Manager SDK for PowerShell
Navigating the Site Recovery Manager SDK for PowerShell
Connect to a Local and to a Remote Site Recovery Manager (SRM) Server
Host-Based Replication Scenarios
Create Protection Group for Host-Based Replication
Create Recovery Plan
Array-Based Replication Scenarios
Configure Array Managers for an Array Pair
Create Replicated Array Pair
Create Protection Group and Recovery Plan for ABR
Managing the NSX Policy API with VMware PowerCLI
Understanding the NSX Policy SDK for PowerShell
Navigate the NSX Policy SDK for PowerShell
Connect to an On-Prem NSX Server
Connect to an NSX Server on VMware Cloud on AWS
Create a Tier-0 Gateway
Create a Tier-1 Gateway
Add an Existing Tier-1 Gateway to a Specific Edge Cluster
Create a Segment (On-Prem)
Create a Segment (VMware Cloud on AWS)
Create a Distributed Firewall Policy
Managing VMware Cloud Director with VMware PowerCLI
Connect to a VMware Cloud Director Server
Create and Manage Organizations
Create and Manage Organization Virtual Data Centers
Filter and Retrieve Organization Virtual Data Center Networks
Import a vApp Template from the Local Storage
Create a vApp Template from a vApp
Import a vApp from vSphere
Create and Modify a vApp
Manage Virtual Machines with vApps
Manage Virtual Machines and Their Guest Operating Systems
Retrieve a List of the Internal and External IP Addresses of Virtual Machines in vApps
Create and Manage Access Control Rules
Filter and Retrieve vApp Networks
Create vApp Networks for a Selected vApp
Create an Isolated vApp Network
Create an NAT Routed vApp Network
Create a Direct vApp Network
Modify or Remove vApp Networks
Managing VMware Aria Operations with VMware PowerCLI
Connect to a VMware Aria Operations Server
Check Memory Waste Levels
Get Remediation Recommendations
Change Alert Ownership
Create a Report for Problematic Hosts
Managing VMware Cloud on AWS with VMware PowerCLI
Connecting to VMware Cloud on AWS
Connect to VMware Cloud on AWS by Using an API Token
Connect to VMware Cloud on AWS by Using an OAuth Security Context
Connect to VMware Cloud on AWS GovCloud (US)
View the Available Software-Defined Data Centers
Connect to a vCenter Server on VMware Cloud on AWS
Connect to a vCenter Server on VMware Cloud on AWS by Using an OAuth 2.0 Authentication
Create a Software-Defined Data Center
Create a Cluster in a Software-Defined Data Center
Set the Elastic Distributed Resource Scheduler (EDRS) Policy of a Cluster
Remove a Cluster from a Software-Defined Data Center
Add Hosts to a Software-Defined Data Center
Remove Hosts from a Software-Defined Data Center
Help and Support for VMware PowerCLI
Generate a PowerCLI Support Bundle