Quantcast
Channel: VMware Communities : All Content - VMware PowerCLI

Host overall status

Hi All, I'm trying to generate the report for Host over all status from multiple vcenter server, but it while running the script. No error. Any pointers will be much appreciated. $userbane =...

View Article


How to get VM Guest/Config ConfiguredGuestId and RuntimeGuestId by using...

Hello, I would like to retrieve the VM Guest properties ConfiguredGuestId and RuntimeGuestId by using get-view and not get-vm.How do I do that? I cannot find it in VMware.Vim.GuestInfo,...

View Article


Move-VM dosent work to move a VM to a DatastoreCluster for Cross VC Migrations

Hi Experts I have a Script to do cross VC migration which works perfectly. We use it everyday and its fabulousRecently we wanted to move a VM which we could not get into one datastore so we used...

View Article

vmk(n) -- portgroup (OpaqueNetwork NDVS)

Hi Expert i would like to get the source code of this view (in attached )  ,i accpet (powershell, powercli, RestAPI,esxCLI, ...)at least i need to get a table with first colomn vmk(number) and in the...

View Article

PowerCLi script to Upload files into datastores for multiple hosts in parallel

Hello Friends, Recently i've got a scenario where i have to upload the files into multiple hosts in their local datastores around 2000+ boxes. I'm trying below scripts to upload the files to selected...

View Article


The module 'VMware.VimAutomation.Sdk' cannot be installed because the catalog...

Unable to install VMware.PowerCLI module getting error asPS C:\> Install-Module -name vmware.powerCLI -scope CurrentUser -Force -allowclobberPackageManagement\Install-Package : The module...

View Article

Get VMXNET3 - Network DirectPath I/O Status

Hello Community, is there a way via script to get all VMs that have DirectPath I/O enabled?

View Article

convert-html command

Hi luc ,can yu please check html command to get proper output .   $path1 = 'D:\hc'$path = "D:\hc\compliance-$(Get-Date -Format 'yyyyMMdd-HHmm').html"  #(get-credential).password |...

View Article


Image may be NSFW.
Clik here to view.

plink issues

any idea why this is not working $esxhosts = get-vmhost -name (get-content esxhosts.txt)#$root_pass = read-host -Prompt "Enter root PAssword"$root_pass = Read-Host -AsSecureString |...

View Article


intellisense _powercli

Hi Luc,   Get-VMHostNetworkAdapter -VMHost $esxi -VMKernel|?{$_.while typing above i was expecting ManagementTrafficEnabled as one of the listed properties but i did not find that .not sure if its a...

View Article

USB passthrough via CLI

Hi, i have a unusual task. I wanted to know how i can passthrough USB devices via CLI, while my VM is on. Basically it always possible and always works fine via UI.   As of today i can do this by...

View Article

send multiple report attachment

Hi all, Need help to modify sending email for report using .net method that can send multiple attachmentthis is the original script : PowerCLI-1/CPReport-v2.1-Community-Edition.ps1 at master ·...

View Article

PowerCLI performance vs clicking 'Export' button in vsphere UI.

Hello!I'm in the process of trying to automate some report gathering and data massaging that I've been tasked to do.  This has led me down the road into PowerCLI, and many posts and answers (especially...

View Article


Image may be NSFW.
Clik here to view.

Software Acceptance Level

I'm trying to get the software acceptance level for some hosts and then provide a resultbasicaly the script should collect the info and then compare it unfortunaly it's not working $esxcli = Get-ESXCLI...

View Article

Image may be NSFW.
Clik here to view.

Get-EsxCli Could not establish secure channel for SSL/TLS with authority

despite that I'm adding the below to my script, I have always the error message : Get-EsxCli Could not establish secure channel for SSL/TLS with authority...

View Article


Ensure the ESXi shell is disabled

I'm trying to create a script to disable ESXi shell, as I'm in the obligation to get the configuration before any change things I made the script like this  #Collect configurationGet-VMHost |...

View Article

Can anyone tell me why this 'else' statement is not working?…

Hi all, I have the following script to retrieve the tags from various vcenter servers however I cannot see why the 'else' statement in line 27 is throwing an error as not recognised? I have checked the...

View Article


How can i find out Power off particular VM time through powercli

How can i find out Power off particular VM time through powercli

View Article

Datastore Load Report - Exclude DataStore

I have a report that shows all datastores in a DC and shows what percent is running on that datastore so I can check the load and keep it balanced manually if needed, but I added a cold storage...

View Article

vCheck health - Does this make any changes ?

Hi All, I think the vcheck health script does not make any changes to vCenter , is that correct ? if yes will a read only account run it good idea ? Thanks

View Article

List of Unused vCenter Roles

Hi all. I'm working on a review of unused vCenter roles in our environment and found this script below. Get-VIPermission | Select Role, Principal, Entity, UID | Export-CSV “E:\JCEM\Rights.csv” However,...

View Article


Image may be NSFW.
Clik here to view.

Overall VM Utilization summary

Hi All, I'm trying to pull the VM utilization summary report for all the VM's in the below format, but it runs forever without any output. Can some experts help me resolve this issue....

View Article


Get-View PodStorageDrsEntry.StorageDrsConfig.VmConfig with UpdateViewData()

Hi, is it possible to use UpdateViewData() method with Get-View on the ViewType "StoragePod" to Update the data of PodStorageDrsEntry.StorageDrsConfig.VmConfigfor the VM names without using another...

View Article

Image may be NSFW.
Clik here to view.

Get-ESXCli get device smart info

When manually pulling the smart info using the NAA Identifier it works. But when it is stored in a variable, it doesn't. I'd like to be able to pull the smart info for all the devices from all the...

View Article

VSS swicth - find missing portgroup & send alert in cluster

Hello What is best way to monitor cluster continuously for a missing port group on vss in cluster & report it. eg cluster of 3 nodes , someone created and added portgroup VLAN10 on host1 &...

View Article


Error when ruuning PowerCLI from .Net application

Hi, I have a .Net app which runs some PowerCLI scripts. I've recently had to rebuild my PC an LAB environment and now certain comands are throwing an error.  The error is : "Could not retrieve handler...

View Article

Get the list of ESXi servers /scratch locations path?

Hi All, Using this script, it is possible to automatically create /scratch directory location for multiple ESXi servers without causing outage during the business...

View Article

import-csv

Hi Luc, i am getting very weird error .following code works fine till orangehowever when i m trying to get vmhost to do further activities it throws error . esxi1.localhost.com get-vmhost : 28/10/2020...

View Article

RVtool like

HI gurus I am looking for a script that will bring up all the information that RVTools gets and export it, but on an specific folder instead of the entire env., is this even possible with pscli? Thanks...

View Article



Get VMs with net adapter not connected

Hi all,I'm trying to get all the VMs that are "connected" state(to exclude maintenance mode ones) and the "Connect at power on" network adapter setting disabled.This is what I have but seems to be not...

View Article

Powershell - get datastore disk usage rather than total VM disk usage

Hi.  Thanks to LucD I am progressing with my script to get vCenter details but the one bit I am stuck on is with regard to the datastore disk usage particularly if a VM has more than one VMDK and they...

View Article

"Invoke-VMScript Failed to authenticate with the guest operating system using...

Hello, I am trying to use Invoke-VMScript to run a specific command on Linux guest machines.The command errors with the following output:Invoke-VMScript : 29-10-2020 12:04:47    Invoke-VMScript  Failed...

View Article

Managing RDM Disks in QE Environment

Hello Folks, I am a QE engineer working with DellEMC PowerMax Storage. We work on SAN environment quite often and provision our storage LUNs to ESXi. Question:Is there an way to manage (add/remove) RDM...

View Article


Image may be NSFW.
Clik here to view.

How to run script in Power CLI

I have powershell version 4.0 and Power CLI version 6.5 Release build 4624819. If I run one line command like  "Get-VMHostNetwork -VMHost $esx | Set-VMHostNetwork -DomainName $domainname -DNSAddress...

View Article

Change MTU on physical ports without downTime

is there a way to change the MTU for physical NICs [vmnic] without downtime? The issue is that MTU 9000 was enabled on vmkernel and not enabled on physical ports which is not recommended and such kind...

View Article

Image may be NSFW.
Clik here to view.

Restart information

Hello,Can someone please help me to how to find the restart information (Windows servers) such as: Date and time and who performed the taskI can get this last reboot information. But here I am looking...

View Article


Datacenter migration script from standard to distributed portgroups with the...

Hello friends,I'm currently working on trying to migrating virtual machines to a new datacenter. Networks are identical (stretched) in both datacenters but we have to do a svmotion to move between...

View Article


Image may be NSFW.
Clik here to view.

DistributedVirtualSwitchInfo with id 'xxx' does not exist

Hello there. I am trying to create vmk intarfaces with New-VMHostNetworkAdapter cmlet, but gettin the error "DistributedVirtualSwitchInfo with id 50 02 5a 5c 8c fc 30 be-15 99 73 74 7d 87 b7 37' does...

View Article

use Get-VDPortgroup cmdlet in the VDS component

Hello I'm using the below script to get VDS Port Group it's working fine but I'm getting the warring message: WARNING: The output of the command produced distributed virtual portgroup objects. This...

View Article

Image may be NSFW.
Clik here to view.

Template Update Script Not Finishing

I have a script that takes a template and converts it, updates the windows, then converts it back.  Script works great with Win2016 & 2019, but I had to make a win10 template and it won't convert...

View Article

Exclude a group of VMs in a get-filter regex

Hi. I am having issues excluding a group of VMs from a regex expression in a get-filter. I won't bore everyone and list everything I tried, which has exhausted me. Essentially I am using this call...

View Article


find VM that was deleted from vcenter

Trying to find a VM that was deleted from vcenter. Probablyt last 2 weeks  is this right? Get-VIEvent-maxsamples ([int]::MaxValue) -Start (Get-Date).AddDays(–14) |...

View Article

Invoke-VMScript Response status code does not indicate success: 403 (Forbidden)

Hi, Hope you're all well. I am using Invoke-VMScript to interact with Windows VMs. Something strange is happening. On my Windows 10 machine every time I do an invoke-vmscript, it carries out the script...

View Article


Update VM template (non domain joined)

Hello, Has anyone found a neat way of updating their VM template with Windows updates without joining to the domain? I have found the following post which is also on another website but wondering if...

View Article

Convert 500+ thick disks to Thin

Hi, I need a script which can covert thick disks to Thin, requirement is aa below. 1. Get VM name/Thick disks list, source datastore  and destination datastore from CSV file.2. Move only the thick...

View Article


IMM Ip Address through PowerCLI

hello I am exeucting following line from https://www.altaro.com/vmware/esxi-ilo-idrac-powercli/Get-VMHostWSManInstance –Vmhost (Get-VMhost ESX01.tglab.lcl) –IgnoreCertFailures –Class...

View Article

Image may be NSFW.
Clik here to view.

powercli Get-Task output language

I want to change the output(TaskName) language

View Article

Is a way to extract installed softwares and version for auditory with PowerCLI?

Hello,         I have an audit. I need to extract for each vm an installed softwares and I don't know if exist a way through vmware cli. Thanks and regards,Tomás

View Article

SCSIcanonicalname?

Hi, I am using the following script to keep track of RDMs in relation to migrations. $DiskInfo= @()$vm = Get-Cluster "CLUSTERNAME" | Get-VM foreach ($VMview in Get-VM $vm | Get-View){foreach...

View Article


Image may be NSFW.
Clik here to view.

DNS

Hello, Can someone please tell me: I have a text file called 'Server_IP' and in that sheet it has all the IPs.Is there anyway I can script and get the DNS names by doing nslookup of that IPs and get...

View Article



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>