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
- vCenter RolesvCenter-roles Import pre-defined roles for common applications to access vCenter. The privileges for each role are stored in a JSON-format file as a list of privilege Ids (Get-VIPrivilege | Select Id) ...vSphere Management SDK PowerShell
- Get or Create vRO Configuration ElementReturns the Configuration Element based on the given Configuration Category Path and Configuration Element Name. If it does not exist, Configuration Category and Configuration Element are created. I ...vRealize Orchestrator JavaScript
- Search vSphere Entities by NamevRO actions to search entities in vCenter by name. The code uses Property Collector that allows faster retrieval times even in large environments. Valid for all versions of vCenter. Possible use ca ...vRealize Orchestrator Plug-in SDK vRealize Orchestrator JavaScript
- Reboot VM and Wait for VMWare ToolsChanged a couple issues found with this original solution: https://code.vmware.com/samples/1143/reboot-guest-os-on-vsphere-vm-and-wait-#code First, the enum constant is no longer valid in vRO 8.x. Se ...vRealize Orchestrator vRO Workflow
- 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
- generate vc support BundleThis sample helps to create the vCenter support bundle. At the end of execution, the script provides the link to download the vc support bundle. Sample usage generate-vc-suuport_bundle.py --vc_ip \\\' ...vSphere Automation SDK for REST Python
- Get Cluster by NameFinds and returns the vCenter ClusterComputeResource with the given name, case-insensitive. Also demonstrates how to do a case-insensitive search via xpath, as supported by the Javascript version of v ...vRealize Orchestrator Plug-in SDK JavaScript
- Is HostSystem Compatible for a vCenter VMUse VM-host compatibility checker, which is native to the vCenter plugin, to determine if a host is compatible with a given VM and resource pool. Useful for host-specific placement when cloning direct ...vRealize Orchestrator Plug-in SDK JavaScript
- Get the Cluster of a vCenter VMReturns the cluster of a given vCenter VMvRealize Orchestrator Plug-in SDK JavaScript
- Get folder of a vCenter VMReturns the VM folder of a given vCenter VMvRealize Orchestrator Plug-in SDK JavaScript