This section provides sample scripts for PowerCLI with basic and advanced tasks in virtual machine administration. What to read next Manage Virtual Machines on vSphereWith PowerCLI, you can automate various administration tasks on virtual machines, for example retrieving information, shutting down and powering off virtual machines. Create Virtual Machines on vCenter Server Using an XML Specification FileYou can use a specification provided in an XML file to automate the creation of virtual machines on vCenter Server. Manage Virtual Machine Templates on vCenter ServerYou can use PowerCLI to create virtual machines templates and convert them to virtual machines on vCenter Server. Create and Use Snapshots on vCenter ServerYou can use the Snapshot parameter of Get-VM to take a snapshot of virtual machines and then revert the states of the virtual machines back to the snapshot. Update the Resource Configuration Settings of a Virtual Machine on vCenter ServerYou can use the Set-VMResourceConfiguration cmdlet to modify the resource configuration properties of a virtual machine, including memory, CPU shares, and other settings. Move a Virtual Machine to a Different Host Using VMware vSphere vMotionYou can migrate a virtual machine between vCenter Server hosts by using vSphere vMotion. Move a Virtual Machine to a Different Datastore Using VMware vSphere Storage vMotionYou can migrate a virtual machine between datastores using the VMware Storage vMotion feature of vCenter Server. Move a Virtual Machine to a Different vCenter Server SystemYou can migrate a virtual machine from one vCenter Server system to another by using Cross vCenter Server vMotion. Add Passthrough Devices to a Host and Virtual MachineYou can get information about existing passthrough devices and add new SCSI and PCI devices to virtual machines and hosts. Apply a Customization Object to a Cloned Virtual MachineYou can apply a custom configuration to a cloned virtual machine by using a customization object. Modify the Default NIC Mapping Object of a Customization SpecificationYou can modify the default NIC mapping object of a customization specification and apply the specification on a newly created virtual machine. Modify Multiple NIC Mapping Objects of a Customization SpecificationYou can modify multiple NIC mapping objects of a customization specification and apply the specification to an existing virtual machine. Create Multiple Virtual Machines that Use Static IP AddressesYou can deploy multiple virtual machines with a single network adapter and configure the deployed virtual machines to use static IP addresses by applying a customization specification. Create Multiple Virtual Machines with Two Network AdaptersYou can deploy multiple virtual machines with two network adapters each and configure each adapter to use specific network settings by applying a customization specification. Parent topic: Managing vSphere with VMware PowerCLI