VMware Sample Exchange
Browse and download code samples from VMware as well as code samples contributed by the VMware community. Log in to Sample Exchange using your MyVMware credentials to submit requests for new samples, contribute your own samples, as well as propose a sample as a solution for open requests.
Disclaimer: All sample content and code in Sample Exchange is licensed to you by the sample's author. VMware does not guarantee the samples; they are provided "AS IS". Use of this site is subject to the VMware Community Terms of Use.
Browse the list below for code samples from VMware and the community. You can filter the list of samples by selecting a platform or language, or enter other search keywords above.
Filters
Type
SDK / Platform / Tool
Contributor
Language
- Powercli script for disabling SLP Service on 6.7 and 6.5 vCenter Servers as per VMware KB76372This script works at VC level, where it will iterate through all the Datacenters and clusters in the VC and disable SLP service on all the available hosts. Script will ensure Firewall Exception RuleSe ...VMware PowerCLI PowerShell
- PowerCLI Set ESXi NTP Source - ESXi 6.7u3 and 7.0u3Set NTP Source Servers for VMware ESXi via PowerCLI - ESXi 6.7u3 and 7.0u3 .SYNOPSIS Set NTP Source Servers for VMware ESXi .DESCRIPTION Example is using Google NTP source IP. This is not for producti ...vSphere PowerShell
- Powercli script for compliance check of baseline with bulletinID as input - VC LevelThis script works at VC level, where it will iterate through all the Datacenters in that VC and provide the compliance report. What the script does: 1. Connects to the VC server 2. Creates a patch bas ...VMware PowerCLI PowerShell
- Powercli script for compliance check of baseline with bulletinID as input - Datacenter LevelThis powercli script works at the datacenter level. This takes datacenter name as the input and does a compliance check against that datacenter in a VC. What the script does: 1. Connects to the VC ser ...VMware PowerCLI PowerShell
- NSX-T DFW Monitoring with vRLI and vROpsPurpose of this scrips are to monitor NSX-T DFW VM and Host metrics, in essence applied DFW rules per vNIC, applied DFW rules per Host and heap usage of each NSX-T module per host, in vRLI and vROps. ...PowerCLI PowerShell
- HCX Migration Scripts... . HCX Migration Scripts These are the migration scripts that I produced with Bilal Ahmed, to automate the HCX migrations and failback capabilities. Blog Posts These blog posts describe the usage o ...VMware HCX PowerShell
- PowerShell Script of Cluster ShutdownThis PowerShell script enables the powering on or off of a vSAN cluster, and is supported by PowerCLI 13.1. It supports both vc not on vSAN and vc on vSAN cases. The cmdlets Start-VsanCluster and Stop ...PowerCLI PowerShell
- Get Instant Clone Pool InformationReturns information on Horizon Instant Clone pool VMs, including space consumed, and hierarchy of Parent, Replica, Template, Snapshot, and Master. Identifies VMs that are potentially orphaned/abandone ...Horizon - View Power CLI Horizon vSphere CLI vSphere VMware PowerCLI PowerShell
- Create CSI Driver vCenter RolesThis script is used to create a new roles on your vCenter server. The newly created role will be filled with the needed permissions for using it with Kubernetes vSphere CSI Driver. The permissions are ...vSphere PowerShell
- Create App Volumes vCenter RolesThis script is used to create a new roles on your vCenter server for App Volumes 2.x, 3.x and 4.x The newly created role will be filled with the needed permissions for App Volumes The permissi ...App Volumes vSphere PowerShell