5 votes

ESXi 6.7 Instant Clone without vCenter

No. Turns out you can't have a three-character answer on this site :)
user avatar
  • 100k
5 votes
Accepted

How can I get VMHost's operating system and serivce pack info using Get-VMHost

What information do you actually want to get? Get-VMHost has a field for build. This will give you the ESXi build number, which is a more reliable way of telling which version of ESXi you are on than ...
user avatar
5 votes
Accepted

PowerCLI Move-VM Returns failure but vm still moves

My understanding of this issue is that in the implementation of Move-VM, PowerCLI runs an async task, gets the task and then runs Wait-Task on it. If the operation is very fast, it will fail with ...
user avatar
  • 166
4 votes
Accepted

How do I open the VMware Remote Console (application) from the PowerCLI?

After more than an hour of searching around and trial-and-error, i followed what Mario Lenz said: C:\Program Files (x86)\VMware\VMware Remote Console\vmrc.exe vmrc://[USERNAME]@[VC]/?moid=[VM-MOREF-...
user avatar
3 votes

VMware Cloning with POWERCLI with nested folder

According to the documentation, the -Location parameter for New-VM expects an object of type Folder. If you're passing in a path string, then it's not going to work. You'd need to use Get-Folder, ...
user avatar
  • 8,980
3 votes
Accepted

Can you list a Datastore Cluster's sDRS Schedule via PowerCLI?

The sDRS schedules are regular vCenter scheduled tasks. There are few blog posts available on how to list these with PowerCLI, e.g. here: https://virtualbyte.wordpress.com/2014/09/05/retrieve-vcenter-...
user avatar
  • 1,478
3 votes
Accepted

Export a list of VMs without a specific tag with PowerCLI

If you want a CSV, you may get more consistent results by changing Out-File ... to be: Export-Csv -InputObject $VM -Path $ExportTo -Append -NoTypeInformation I believe the output of Get-VM is a JSON ...
user avatar
  • 3,314
2 votes

vmware thin disk usage powercli

The actual used disk space is retrievable without accessing the datastore separately, but you won't find the information in the disk object, but rather in the VM object. It is hidden in $vm....
user avatar
2 votes

How do I open the VMware Remote Console (application) from the PowerCLI?

I didn't have a look at VMRC yet and I'm no PowerCLI expert, but it looks like you can open a console like this: C:\Program Files (x86)\VMware\VMware Remote Console\vmrc.exe vmrc://[USERNAME]@[VC]/?...
user avatar
  • 1,612
2 votes

Trouble with embedding html email with PowerCLI/Powershell for gmail

Gmail strips out the style tags. You will need to put your style inline. It will probably be easiest to perform string manipulation on $Report. For example: $newhtml = $Report -replace ('<td','<...
user avatar
  • 233
2 votes
Accepted

PowerCLI automation set-cddrive error

The link you mention says it is resolved in powercli v6, this is true in my experience. In my v5 code I always uses set-cddrive -ErrorAction:SilentlyContinue but It is not needed now.
user avatar
  • 544
2 votes

PowerCLI Move-VM Returns failure but vm still moves

Just in case anyone else comes across this issue, it would appear that the $task variable doesn't update by itself. In my case, I had to do: while($task.state -eq "Running") { Start-Sleep 5 $...
user avatar
  • 21
2 votes
Accepted

Get-VMHost does not show the server Networkinfo and number of processes

Under the networkinfo column I got the following "localhost:" instead of getting the host ip, mac, et.. so what is causing the NetworkInfo to not show the actual network info ? The NetworkingInfo ...
user avatar
  • 8,980
2 votes
Accepted

Unable to connect to server using its name "Connect-VIServer "

From (the little) that i know: If you own the domain name and this domain name is registered to a Registration Authority and the entry is being added correctly into the Zone file of a Name Server ...
user avatar
  • 192
2 votes

Rapid deployment of similar VMs

Pity you're not on v6, it has this thing called Instant Clone that would speed up this kind of deployment. Anyway have you thought about just using a DHCP/dynamic-DNS solution for this kind of thing, ...
user avatar
  • 100k
2 votes
Accepted

VM restarted by HA after powered off from PowerCLI

Have you tested this without -Kill? From the Stop-VM cmdlet reference: Indicates that you want to stop the specified virtual machines by terminating their processes running on the ESX. You can use ...
user avatar
  • 24.1k
2 votes

vSphere PowerCLI storage vMotion

I use this in part of a longer script I wrote for a migration projects. This is pulling names and csv I built earlier in the same script. Get-HardDisk -vm $line.Name | where {$_.filename -match $...
user avatar
  • 197
2 votes

Script to storage vmotion from one datastore to another

To get batches of 10 you can use Select-Object with the parameters -First and -Skip: $start = 0 do { $VMs |Select -First 10 -Skip $start | Move-VM -Datastore $NewDatastore | ...
user avatar
2 votes

Query ESXi memory slots/installed memory modules from PowerCLI 4.1

With the smbiosDump command it is possible to know how many RAM expansion slots and which are connected in each one. Example: To know the number of slots: smbiosDump | grep -A 4 'Physical Memory ...
user avatar
2 votes

How to Move Multiple VM's to Different datastore

-Datastore requires a datastore object, but you are providing an array of strings. This should work: Get-Datastore $existingds | Get-VM | Move-VM -DiskStorageFormat Thick -Datastore (Get-Datastore $...
user avatar
1 vote

Get-VM command with -Location parameter returns one result then error

Ok, i found the solution, maybe was an incompatibility between version installed. I opened a Powershell and installed powercli modules from PSGallery. Now it works.
user avatar
1 vote
Accepted

vSphere PowerCLI storage vMotion

It turns out you can't simply Move-HardDisk $hd -Datastore $dstds which will give a message that the disk is locked. But instead you can do something along the lines of: Get-HardDisk -VM MyVM -Name ...
user avatar
  • 2,795
1 vote
Accepted

How can I get the VMware view agent version of VMs with powercli?

You would use vdmadmin.exe which is available on your connection server in \Program Files\VMware\VMware View\Server\bin. vdmadmin -d <pool> -getversion D:\Program Files\VMware\VMware View\...
user avatar
1 vote

powercli math with vmware - datastore property division arithmetic

First, you are missing the underline between the $ and the dot. To access properties of a piped object, you have to use: $_.ExtensionData.Summary.Capacity Second, i think your calculation is wrong: ...
user avatar
  • 1,236
1 vote
Accepted

unable to get the IP,Mac, and other network info using (Get-VMHost).NetworkInfo

You'd probably want to use the Get-VMHostNetworkAdapter cmdlet. In particular, using the -VMKernel switch to only get the host's management interfaces. Something like this: Get-VMHost <hostname&...
user avatar
  • 8,980
1 vote

Connect-VIServer will always propt a dialog to enter username & password

I believe the User and Password parameters have been deprecated in the newest versions of PowerCLI. Use -Credential with a pscredential object instead: $Username = 'root' $Password = 'Sup4hS3cuRe' | ...
user avatar
1 vote

Using PowerCLI Versus using asp.net WMI to scan and retrive informaion about ESX hosts

What you are looking for is called the vSphere API. You can find the documentation for Version 5 of the API here.
user avatar
  • 19.5k
1 vote

How do I open the VMware Remote Console (application) from the PowerCLI?

You can click on the VM in Vcenter. Right click and go down to console. Launch Remote Console. It will call vmrc.exe for you.
user avatar
1 vote

How do I open the VMware Remote Console (application) from the PowerCLI?

EDIT: PowerCLI 6.5, announced on the PowerCLI blog 2016-11-17, installs VMRC and launches it with the Open-VMConsoleWindow command, ex. Get-VM -Name *VM-name* | Open-VMConsoleWindow Tunsworthy has ...
user avatar
  • 111
1 vote

ESXcli command timeout at 30 minutes

You mentioned: I have been unable to find a 30 minute session timeout which I can tweak in the script. I attempted to remove or increase the Web Session Timeout in PowerCLI without success:> ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible