Questions tagged [powercli]

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 600 cmdlets for managing and automating vSphere, vCloud, vRealize Operations Manager, vSAN, NSX-T, VMware Cloud on AWS, and VMware Horizon environments.

Resource for Downloads and Documentation and Reference

83 questions
1
vote
1 answer

Resetting the VMware PowerCLI global:DefaultVIServer and global:DefaultVIServers system variables?

Can anyone here please assist me in resetting the global:DefaultVIServer and global:DefaultVIServers system variables into $null ? because I cannot do anything with my PowerShell anymore even after reinstalling the PowerCLi and upgrading it into…
Senior Systems Engineer
  • 1,275
  • 2
  • 33
  • 62
1
vote
1 answer

Scripting changes to the vNIC in vSphere for a cloned VM

After deploying a Windows VM clone from a template, how can a script be written to change the network the vNIC is on ("Network label" in the VM Settings window) and enable the NIC? I'm working with templates built in one environment that need to be…
warren
  • 18,369
  • 23
  • 84
  • 135
1
vote
2 answers

ESX + Sysprep.inf + Template= unhappy computername

I am trying to create a template in ESX that I can automate with PowerCLI. Everything works great so far, but because I have some specific settings, I had to create my own sysprep.inf. Now, the computername and the VM guest name are out of synch. …
breadly
  • 217
  • 2
  • 12
1
vote
0 answers

ISO not booting using powwercli

Using below codes I am able to mount ISO to the CD drive of a VM and change the BootOrder of the VM $CloneVM = Get-VM -Name "999_SW999OSTest_Clone" $IsoPath = "[NPROD_LUN-01_DEV_3333]…
1
vote
2 answers

When a VM Template was last used (to create a VM)?

I need to know when a VM Template was last used (to create a VM)? As I am working on a project of segregating unused templates in my vSphere environment, I need to know that answer. I tried Get-Template TemplateName | select * But is not giving me…
1
vote
1 answer

Powercli create local user and assign permission At VC level

I need a powercli script to automate some task in VC , I have found below script but here I can assign AD group permission to folder level. but I want to assign permission at VC level. is there any way we can do…
karthick
  • 327
  • 1
  • 4
  • 12
1
vote
0 answers

Unable to Read VSAN Datstore Items using powercli, it is returning UUIDs instead of Name

I'm trying to upload an ISO to VSAN datastore using Powercli. I want to check if there is a folder named ISO, if not, create and upload to that folder. For other DS Types (VMFS), I have not faced any issue. I was mounting the DS on a PSDrive using…
1
vote
0 answers

How can I get the current network in/out values of any NIC of a VMware ESXi host server?

I am aware that IF-MIB provides input and output values for any NIC of a target device via SNMP. Recently a sysadmin compared the values of a specific NIC of an ESXi host server in our VCenter with the correspong values SNMP provides. The thing is…
1
vote
0 answers

Getting the name of the Snapshot from a specific VM?

How can I get the name of the snapshot that the particular machine is using? I have tried: Get-VM -Name vdix-test-01 | Get-Snapshot but it returns blank.. I am trying to retrieve the name of the base image here: VMWare Horizon 7 Console Any help is…
1
vote
1 answer

Automate VMWare Config Backups

I am looking for a way to automate nightly backups of my VMWare ESXi Configs for disaster recovery. Ideally the script would connect to my vCenter server, poll it for hosts, and then backup the config in a logical directory structure, including…
Glenn Sullivan
  • 1,368
  • 9
  • 17
1
vote
1 answer

Add Network Adapter to VM in vCloud Director using PowerCLI

I am using the PowerCLI version 12 and have a VM which currently has no network adapter. There is the Cmdlet Get-CINetworkAdapter but that returns null (because there is no adapter) And there is Set-CINetworkAdapter but again without a…
0
votes
1 answer

Script to storage vmotion from one datastore to another

Ive done some searching and could not find what I'm looking for so I am making a post: I would like to storage vMotion from one datastore to another, 10 at a time, and output the vm's migrated to a log file. I have this script so far that I have…
0
votes
1 answer

PowerCLI - Get Active FC Path WWN of all datastores

I need to turn off one of the FC switch for maintenance. To turn off the switch smoothly, I want to set the manual path selection mode and switch all datastores to the second switch. I have a lot of datastores, so I wanted to create a csv file in…
shallrise
  • 89
  • 1
  • 13
0
votes
0 answers

Powershell / Powercli script Cronjob

I made a Powershell script which uses Powercli to create and delete snapshots on my two Esxi hosts, but for some reason the Cronjob isn't working. In the syslog I can see the following message: (v6.1.0-preview.2:1:80) …
newduino
  • 29
  • 1
  • 3
0
votes
1 answer

Utilize Measure PowerShell command to get vCenter VMs HW versions

I've never used PowerShell measure command, but found it pretty handy and it can make my code shorter. For now I'm looking how to get a report about VMs count and HW version they run on. Using latest gratest vCenter 6.5 U2 and PowerCLI 10.1 Output…