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

SDK / Platform / Tool

  • Automation Tools

  • Cloud Management Platform

  • Cloud Native Applications

  • Data Center & Cloud Infrastructure

  • Desktop & Application Virtualization

  • Developer Tools

  • Enterprise Mobility Management

  • Hybrid Cloud & Data Center Infrastructure

  • Networking & Security

  • Storage & Availability

  • Other Platform

Contributor

Language

1 - 10 of 43 Results Sample PowerCLI
  • Move ESX to a Datacenter

    Contributor nilmax

    Introduction and Purpose This sample code provides functions that moves an ESX to the location that is specified by the Datacenter parameter. Before running this sample, you can make sure you have the ...
    vSphere Management SDK PowerShell
    Download

    604 Downloads

    0 Comments

    Updated 2 years ago

  • Solution 2- Report on VMs with multi-writer flag enabled

    Contributor vThinkBeyondVM

    What this script does: This script first downloads all the VMX files (per host/cluster/datacenter/VC)at specified file location and scans each VMX file for "multi-writer" flag and finally prepare a re ...
    VMware PowerCLI vSphere Management SDK PowerShell
    Download

    424 Downloads

    0 Comments

    Updated 2 years ago

  • Report on VMs with multi-writer flag enabled

    Contributor vThinkBeyondVM

    What this script does: This script connects to the vCenter Server and prepares a report on All VMs with at-least one disk enabled with "Multi-Writer" sharing. Author:  Vikas Shitole   www.vThinkBeyond ...
    VMware PowerCLI vSphere Management SDK PowerShell
    Download

    284 Downloads

    1 Comment

    Updated 8 hours ago

  • Getting Cluster usage data on CPU Memory and Storage resources

    Contributor vThinkBeyondVM

    What this script does: Report on Cluster usage/capacity data on CPU, Memory and Storage resources across all the cluster in a vCenter server. Author:  Vikas Shitole   www.vThinkBeyondVM.com    
    vSphere Management SDK VMware PowerCLI PowerShell
    Download

    503 Downloads

    1 Comment

    Updated 8 months ago

  • DRS Rules For all VMs In Cluster

    Contributor vThinkBeyondVM

    What this script does: Report on DRS cluster VMs and its assciated VM-VM affinity/anti affinity rules. Author: Vikas Shitole www.vThinkBeyondVM.com
    vSphere Management SDK VMware PowerCLI PowerShell
    Download

    302 Downloads

    0 Comments

    Updated 2 years ago

  • Backup or Restore SPBM Profiles in vCenter

    Contributor Jasemccarty

    This script will either export SPBM policies to a folder or import SPBM policies from a folder. Tested on vCenter 6.5 with PowerCLI 6.5, but should work with earlier versions. Syntax is: To Backup SPB ...
    VMware PowerCLI PowerShell
    Download

    184 Downloads

    1 Favorite

    1 Comment

    Updated 11 months ago

  • 2 Node Forced Warm Cache for Hybrid vSAN

    Contributor Jasemccarty

    This script forces reads to occur across both hosts in a 2 Node vSAN configuration. More information on the how and why, can be found here: https://blogs.vmware.com/virtualblocks/2016/04/18/2node-read ...
    VMware PowerCLI PowerShell
    Download

    148 Downloads

    0 Comments

    Updated 7 months ago

  • NVME Information

    Contributor alanrenouf

    Find details on the NVMe devices attached to an ESXi Host
    VMware PowerCLI PowerShell
    Download

    172 Downloads

    0 Comments

    Updated 2 years ago

  • Home Lab Deployment

    Contributor alanrenouf

    Script to automate the build of a home lab to vSphere 6.5, this script starts from ESX and configures VSAN, deploys vCenter and configures it and adds William Lams Content Library
    VMware PowerCLI PowerShell
    Download

    1139 Downloads

    1 Favorite

    0 Comments

    Updated 2 years ago

  • VMware Virtual SAN -- All Flash Automated Deployment for Stretched Cluster

    Contributor alanrenouf

    vSAN All Flash Automated Deployment For Stretched ClusterVMware Virtual SAN -- All Flash Automated Deployment for Stretched Cluster
    VMware PowerCLI PowerShell
    Download

    255 Downloads

    0 Comments

    Updated 2 years ago