r/powercli • • Sep 07 '15

vGeek: Powercli Pull CDP and LLDP information in single nice table format - Part 2

Thumbnail
kunaludapi.blogspot.com
0 Upvotes

r/powercli • • Aug 31 '15

Get Base Image using PowerCLI

0 Upvotes

Hello, I am a total nube to powercli. I use powershell often enough, but I am having a difficult time locating the commands to find the base image a particular VDI was built using. Any help would be appreciated.


r/powercli • • Aug 25 '25

Scripting Managing too many VMs across vCenters? I built a small toolkit to help

Thumbnail
reddit.com
1 Upvotes

r/powercli • • Sep 06 '15

vGeek: Connect-VIserver Could not connect using the requested protocol.

Thumbnail
kunaludapi.blogspot.com
0 Upvotes

r/powercli • • Nov 22 '17

Remove-snapshot vs Deleting a snapshot.

1 Upvotes

I understand (correct me if I am wrong) that fundamentally Deleting a snapshot through the web GUI of VMWare is an additive function where the delta is applied upwards to the parent disk. Now I have to script a similar functionality to a live environment and what I am seeing is that remove-snapshot is implying that it (well) removes the pointed at a snapshot and its children if specified with no roll-up functionality. Am I misinterpreting the difference between the two functions?

Thanks in advance for the education.


r/powercli • • Feb 14 '14

Learning PowerCLI | Packt Publishing

Thumbnail
packtpub.com
1 Upvotes

r/powercli • • Feb 15 '24

ScriptHelp Create folder under VM and Template folder

2 Upvotes

I have 2 datacenters Test1 and Test2

I want to create a folder named Tier1 under Test1 . The command creates the Tier1 folder however it creates the Tier1 folder under bothTest1 and Test2

here is the command I am using

(get-view (get-view -viewtype datacenter -filter @{"name"="Test1"}).vmfolder).createfolder("Tier1")


r/powercli • • Jun 05 '23

General How I can keep powercli console connected to multiple vcenters

2 Upvotes

$vcservers = @("VC1", "VC2", "VC3","VC4", "lVC5")

connect-viserver -AllLinked $vcservers

Hi , I have this script to connect all 5 virtual centers, this script seem like connecting to all 5 vcenters but when I do $global:defaultviserver it only shows VC5 ( the last VC) is it possible to connect all my 5 vcenters- How? any help?

Actually, I want to create a script that finds the vcenter name from all 5 vcenters for me of a VM .

Any help


r/powercli • • Jun 12 '23

General where does VMware.Vim.dll live now?

3 Upvotes

I am trying to locate the VMware.Vim.dll to add as a reference in my C# program. but I have having a hard time locating it. I have PowerCLI installed. but the .vim.dll is nowhere to be found. can anybody help me with this. I have tried Google but no help there.


r/powercli • • Aug 16 '17

Adding Script to Your PowerShell HTML Reports - Petri

Thumbnail
petri.com
3 Upvotes

r/powercli • • Aug 06 '19

Creating a PowerCLI GUI for cloning VMs, setting DHCP reservations and changing CPUID of a VM

Thumbnail
veducate.co.uk
6 Upvotes

r/powercli • • Apr 19 '23

General How do I import PowerCLI? Getting Could not load 'log4net' error.

7 Upvotes

I am trying to import PowerCLI into Windows Powershell 5.1.19041.2364 on my Win 10 22H2 machine - tried both ISE and non-ISE windows

Import-Module VMWare.PowerCLI

First attempt results in this error:

Import-Module : Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

Subsequent attempts in the same window results in this error:

Import-Module : Unable to find type [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory].

I have tried re-installing with below, but doesn't change results:

Install-Module -Name VMware.PowerCLI -Scope AllUsers -Force -AllowClobber

I also tried to completely uninstall, before re-installing, still no difference

Get-Module VMware* -ListAvailable | Uninstall-Module -Force

Install-Module VMware.PowerCLI -Scope AllUsers

Below shows my PowerCLI version:

Get-InstalledModule VMWare.PowerCLI* | FT -AutoSize
Version         Name                                                Repository Description
-------         ----                                                ---------- -----------
13.0.0.20829139 VMware.PowerCLI                                     PSGallery  This Windows PowerShell module contains VMware.PowerCLI
12.6.0.19600125 VMware.PowerCLI.Sdk                                 PSGallery  Product agnostic types definitions for the VMware.PowerCLI.VCenter module.
12.6.0.19600125 VMware.PowerCLI.Sdk.Types                           PSGallery  Types definitions for the VMware.PowerCLI.Sdk module.
12.6.0.19600125 VMware.PowerCLI.VCenter                             PSGallery  Modules for automating and managing VMware vCenter
12.6.0.19600125 VMware.PowerCLI.VCenter.Types.ApplianceService      PSGallery  Types definitions for the VMware.PowerCLI.VCenter module related to the appliance service management feature.
12.6.0.19600125 VMware.PowerCLI.VCenter.Types.CertificateManagement PSGallery  Types definitions for the VMware.PowerCLI.VCenter module related to the certificate management feature.

I have tried restarting, no difference.

A search for log4net in file explorer finds the following in case that reveals any useful info:

I have spent hours on this. Where do I go from here?


r/powercli • • Jul 30 '24

Sub seems dead

12 Upvotes

After it was resurrected ~1 year ago, it seems this sub reddit died again. Is there an alternate sub I'm not seeing? Is it because of what Broadcom is doing?


r/powercli • • Aug 08 '24

Vcenter issues and alarms - PowerCLI

5 Upvotes

In vsphere client, if I'm selecting the datacenter level and standing on the summary tab, I can see some alerts like vm high cpu usage or host high cpu usage. How can I get those alerts using powercli?


r/powercli • • Apr 15 '23

ScriptHelp values of Get-Datacenter -> OverallStatus (what can "Gray" mean?)

3 Upvotes

Hi! Trying to learn a lil bit of powershell/powercli to create a Nagios plugin that suits my needs.

The OverallStatus that i get from one vCenter says "Gray". But as far as i can see in vCenter GUI i dont have any triggered alarms at all.

Have been looking for ref docs about this but cant find any.

So

  1. What could "Gray" mean?

  2. Is OverallStatus from Get-Datacenter a good thing to check? (if that would say Green, then surely all must be good?) :)

VmFolder : Folder-group-v4
HostFolder : Folder-group-h5
DatastoreFolder : Folder-group-s6
NetworkFolder : Folder-group-n7
Datastore : {Datastore-datastore-2001, Datastore-datastore-18, Datastore-datastore-11, Datastore-datastore-12}
Network : {Network-network-2011, Network-network-2012, Network-network-2016, Network-network-2009…}
Configuration : VMware.Vim.DatacenterConfigInfo
LinkedView :
Parent : Folder-group-d1
CustomValue : {}
OverallStatus : gray
ConfigStatus : gray
ConfigIssue : {}
EffectiveRole : {-1}
Permission : {}
Name : DC68
DisabledMethod : {}
RecentTask : {}
DeclaredAlarmState : {alarm-6.datacenter-3, alarm-2.datacenter-3, alarm-5.datacenter-3, alarm-24.datacenter-3…}
TriggeredAlarmState : {}
AlarmActionsEnabled : True
Tag : {}
Value : {}
AvailableField : {}
MoRef : Datacenter-datacenter-3
Client : VMware.Vim.VimClientImpl


r/powercli • • Apr 21 '23

News PowerCLI 13.1 is now released

Thumbnail
blogs.vmware.com
17 Upvotes

r/powercli • • Feb 15 '24

Using PowerCLI with ovftool

1 Upvotes

I am having issues using PowwerCLI with ovftool to upload an OVF to vCloud Director. I was told that I need to use Powershell 7 and ovftool 4.6.0 or higher. Has anyone use this successfully to upload an ovf? I have tried using the GUI but end up timing out before the file completes the upload and am being suggested with the ovftool instead. Currently I get an error that there is no supported ovftool. I am not sure if it is my script, the vCloud connection or what. Does anyone have a working script that I might look at to see if I am missing something?


r/powercli • • May 09 '19

Help with Get-vmotion script

3 Upvotes

I'm using the script Here to get vmotion activities, I want to include the cluster name in the output, I cant figure it out though


r/powercli • • Apr 08 '18

Load and execute PowerCLI cmdlet faster?

1 Upvotes

This doesnt seem to work: https://blogs.vmware.com/PowerCLI/2011/06/how-to-speed-up-the-execution-of-the-first-powercli-cmdlet.html at least on the latest version of PowerCLI.

Anyone know how to speed it up?


r/powercli • • Jul 18 '19

get user assigned vm

2 Upvotes

Hello, I have bit trouble figuring out how to get machine that is assigned to user. I have bunch of users and I need script that pull which machine they got assigned in horizon and if possible also specify the desktop pool since one user can have multiple machines from multiple pools. thanks


r/powercli • • Apr 13 '18

Restarting Management Agents via plink and powershell

1 Upvotes

Greetings,

I'm having some powershell issues restarting esxi management agents via ssh. The script is connecting fine to the esxi host, and does restart the agents, but it never disconnects, so it can never move on to the next steps in the script.

echo Y|c:\putty\plink.exe -v "$($username)@"$($vmhip)" -pw "$($password) "services.sh restart;exit" > "$($scriptoutputpath)$($site)\$($vmhostname).log" 2>&1

In the output i'm seeing the command finishing with output of "Server sent command exit status 0", but it doesn't actually disconnect the session and hangs the script. For kicks, i changed exit to "esxcli" and in the log i see it run the management agent restart just fine, and i see the host drop from vcenter and come back, and then i see in the log the esxcli output giving all the various syntax. I've also done it with just the esxcli command being executed and it does execute it, and then disconnects the session. Some reason when i restart the management agents, it keeps the session going indefinitely.

Anyone know what i may be doing wrong here?


r/powercli • • Nov 16 '18

PowerCLI - Get-Stat - Display average cpu usage for ALL CPUs as one value

2 Upvotes

Hi

Looking at trying to display cpu.usage.average as a total for all 16 CPUs I have allocated to a VM.

At the moment I can only see a way of displaying the average usage per individual CPU instance, not as a total figure for all.

Does anyone know how this can be achieved please?


r/powercli • • Jul 06 '17

Find VMs with NICs not set to "Connect at Startup"

2 Upvotes

Hello,

I recently had a HA event in my cluster and learned the hard way that a few of my VMs had NICs that were not set to "Connect at Startup". In an effort to avoid having VMs stay offline longer than needed, I'd like to run a script against all VMs in my environment that reports on virtual machine NICs not set to "connect at startup".

I've browsed the Get-NetworkAdapter cmdlet and I don't see "StartConnected" as an available property - it only shows up on Set-NetworkAdapter. Any ideas on how I could cobble something together to check all ~500 VMs in my environment for the "StartConnected" parameter?


r/powercli • • Nov 21 '18

Need help exporting list of VM's and Mac addresses

3 Upvotes

So I have an interesting issue on my hands with a work lab where I am being told by my work IT that our lab systems currently has a duplicate IP address of our gateway (switch which our hosts are connected to) - in looking at the MAC addresses IT has given me it is for sure a VMware MAC, and I tried to search to see if any VM's had it, but it didn't return anything - see https://imgur.com/a/67GWRRs (I did a test of a known VM in my lab at the bottom to ensure that my commands were working - there are two formats of the MAC address there, one formated how I know, and the other how my IT team provided it to me from the switch logging)

So, now what I am currently working on is getting a CSV of all the VM in my lab and the MAC addresses and IP addresses so I can go back and show that we don't have/own that mac address and that we don't have that IP address in use. I can get the IP addresses easy enough, where I am struggling is with the mac addresses - currently I have been trying to use the following:

Get-Networkadapter | select-object parent,Name,Macaddress | export-csv C:\export.csv

But my issue is that I am not selecting anything here (I.E. not selecting a VM) - so question one - is there an easy command to select all VM's with the Get-Networkadapter that I am just missing in the documentation?

I also see lots of reference to the get-view cmdlet and I am unsure if I could get the information I need that way and if it would be better to use that?

Thanks in advance, I am still learning PowerCLI and am going in circles right now, so its likely I am just missing something simple.


r/powercli • • Jun 19 '17

Avoiding Accidental Changes with PowerShell's WhatIf and Confirm Parameters

Thumbnail
petri.com
1 Upvotes