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
- PowerCLI Port of RVC command vsan.stretchedcluster.witness_infoThis script includes a function that reports the vSAN Witness information for a 2 Node or Stretched vSAN Cluster. Information included is: Cluster Name Witness Host Name Witness Uuid Witness IP Addre ...VMware PowerCLI PowerShell
- Listing vSphere Alarms - Get-TriggeredAlarmThis function lists the triggered alarms for the specified entity in vCenter. More information available: https://blogs.vmware.com/PowerCLI/2019/11/new-vsphere-alarm-management.htmlVMware PowerCLI vSphere PowerShell
- Get Horizon EntitlementsThis script connects to a Horizon Connection Server and returns all desktop and app pool entitlement groups & users in the PodHorizon - View Power CLI PowerShell
- Skyline FixerRun this code with your CSV output and it will talk to the vcenter and change the ESX and/or VM settings. It currently is working for ntp and syslog, but you can add more KB options. I will upload a ...VMware {code} PowerShell
- NSX Get Rules Count V 1 . 2This script uses PowerCLI and Posh-ssh ti retrieve the list of nsx rules applied ti VMs on ESXi hosts and counts the total of rules. This mainly helps identifiy any hosts that are reaching the 10 000 ...VMware PowerCLI PowerShell