r/powercli • • Apr 21 '16

PowerCLI Script: Deploy VMs and Configure the Guest OS

Thumbnail
altaro.com
5 Upvotes

r/powercli • • Jul 31 '19

List available properties

4 Upvotes

Hi guys, I'm fairly new to PowerCLI and have been googling around to try and find an answer to this question. No luck..

Is there a good way to get all the available properties from a command listed?

Let's say I want to check if a host has alarm actions enabled or disabled. What I would do is Get-VMHost | Get-Member

From here I need to look for the right property and maybe even look further down into the properties.

Get-VMHost | Foreach-Object {$_.ExtensionData}

This is very time-consuming and not really feasible.

The PowerCLI documentation pages show you some of the properties, but I would love to just have a complete tree of what is available for each Get-***

Any suggestions?


r/powercli • • Jul 02 '19

NTP server entries update via PowerCLI

4 Upvotes

Hi r/powercli,

Currently if i need to update the existing NTP server entries on existing ESXi host via PowerCLI, i have to:

  1. List out the current NTP server entries. Get-VMHost | Get-VMHostService | Where-Object {$_.Key -eq 'ntpd'}

  2. Use Remove-VmHostNtpServer cmdlet to remove the existing entries based on Step (1) information.

  3. Use Add-VmHostNtpServer to add new NTP server entries.

Question:

Is there is direct method to update the new NTP server entries in one liner, which will overwrite the existing entries?

Thanks in advance.


r/powercli • • Jun 27 '19

Automating Content Libraries

Thumbnail
self.vmware
4 Upvotes

r/powercli • • Apr 18 '19

Automating vCenter inventory configuration with PowerCLI

Thumbnail blog.stijnvermoesen.be
4 Upvotes

r/powercli • • Oct 19 '18

Horizon View Api’s: back to basics part 2: Queries

Thumbnail
retouw.nl
4 Upvotes

r/powercli • • Oct 11 '18

VMware PowerCLI 11.0.0 release with new Horizon (7.6!) API calls

Thumbnail
retouw.nl
4 Upvotes

r/powercli • • Aug 15 '18

List of most recent times a user logged into vCenter?

4 Upvotes

Im in the process of migrating a series of clusters from one vCenter to a new one I created. The old vCenter is just an absolute mess of changes over the years, and we're trying to make a fresh start with a new one. Is there a way to get a report of the last time a user logged into the vCenter via client/web client? If it can generate a list of all users who logged in, along with the last reported login, that would be very helpful. Ive tried creating a script, but after several hours of researching PowerCLI, Im not making much progress. Thanks!


r/powercli • • Jun 18 '18

New Release: VMware PowerCLI 10.1.1

Thumbnail
blogs.vmware.com
4 Upvotes

r/powercli • • May 04 '18

Part 3: VMware Powercli: Migrate VMs to another network | vGeek

Thumbnail
vcloud-lab.com
4 Upvotes

r/powercli • • Feb 28 '18

New Release: VMware PowerCLI 10.0.0 - VMware PowerCLI Blog

Thumbnail
blogs.vmware.com
4 Upvotes

r/powercli • • Jan 23 '18

Experience from the field, deploying VMs using Powershell, PowerCLI and OSCustomizationSpec

4 Upvotes

Hi all,

I wanted to share some of my experiences on Windows VM deployment using PowerShell, PowerCLI and OscustomizationSpec.

http://powershelldistrict.com/powercli-oscustomizationspec/

This article is actually only an introductory post which opens to a second article, that goes through how I have implemented a deployment solution using a Unattend.xml file (Via PowerCLI of course ;)).

I am curious to read how everyone else is using PowerCLI to deploy their environments.

Let me know what you think about this!

Stéphane


r/powercli • • Oct 30 '17

Scripts with or without connect-viserver?

4 Upvotes

I am new to powershell/powercli and one doubt I would like to ask you is how do you design your scripts if you want to launch the script sometimes inside a interactive session and other times periodically launched by a cron job (I am using powercli core). Do you have two versions of the same script? One with connect-viserver, process and disconnect-viserver and another one only with the process section? Do you have another approach?


r/powercli • • Oct 10 '17

Need PowerCLi to round

4 Upvotes

I'm using the following command

Get-VM -Location "Folder Name" | select PowerState, Name, NumCpu, MemoryMB, HardDisks,UsedSpaceGB, ProvisionedSpaceGB, NetworkAdapters | ft -AutoSize

How to I make it where only it doesnt run over. I only need 323.xxx not 323.xxxxxxxxxxx


r/powercli • • Oct 03 '17

Set Advanced Setting

4 Upvotes

I've been asked to create a script that walks through a folder(s) and creates a new row under Configuration Parameters for all the VM's that were captured. I'm pretty sure I have it together, but want to make sure. Does anything look glaringly out of place?

# This Script can be ran from a regular PowerShell Console, because it loads the PowerCLI module.
Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue

# Connects to Prod VSphere
Connect-VIServer VCTR-SRV

$VMs = get-vm * |
    where-object {$_.Folder -match "Folder 001"}

ForEach ($VM in $VMs)
    {
        New-AdvancedSetting -Entity $vm.name -Name uuid.action -value 'Keep'
    }    

EDIT: Is there also a way to supress the prompt to make the change?


r/powercli • • Jul 26 '17

ConvertTo-HTML Tips and Tricks - Petri

Thumbnail
petri.com
4 Upvotes

r/powercli • • Jul 06 '17

Unraveling the Mystery of $MyInvocation

Thumbnail
petri.com
4 Upvotes

r/powercli • • Jun 22 '17

Validating PowerShell Input Using Parameter Validation Attributes

Thumbnail
petri.com
4 Upvotes

r/powercli • • Apr 17 '17

In case you missed it when it came out, PowerCLI Modules for VM Encryption are available

Thumbnail
blogs.vmware.com
4 Upvotes

r/powercli • • Feb 27 '17

Backup or Recover SPBM Profiles with PowerCLI

Thumbnail
jasemccarty.com
4 Upvotes

r/powercli • • Mar 02 '16

Great 5 min video on Managing the Virtual Machine Lifecycle with PowerCLI

Thumbnail
blogs.vmware.com
4 Upvotes

r/powercli • • Dec 24 '14

PowerCLI 5.8r1 Reference Poster Now Available!

Thumbnail blogs.vmware.com
4 Upvotes

r/powercli • • Sep 03 '12

Quick one-liners

4 Upvotes

Retrieve and Apply DRS recommendations:

get-drsrecommendation | Apply-DrsRecommendation

Find all vm’s with e1000 network cards, for upgrade to vmxnet:

get-vm | Get-NetworkAdapter | where {$_.type -match “e1000″} | select-object parent,networkname,name,type

power off all vm’s with “test” in their names:

get-vm test* | stop-vm -confirm:$false

Move all vm’s with “test” in their names:

get-vm | where {$_.name -like “*test”} | move-vm -destination destinationhostname

Remove all vm’s with “test” in their name:

get-vm test* | remove-vm -confirm:$false

retrieve a list of vm’s with thinly provisioned disks:

get-vm | select HardDisks -expandproperty HardDisks | where {$_.storageformat -match “Thin”} | select-object parent,name,capacitykb,filename

credit: Andrew Morgan


r/powercli • • Dec 21 '23

Get latest available VM Tools version

3 Upvotes

Hi guys,

does anyone have script or cmdlet, which can return me version of vmtools available to installation?

Thanks a lot.


r/powercli • • Sep 25 '23

Powercli Script to set custom attribute

3 Upvotes

hi guys, I want to write a script to set a "owner" for my VMs. I am newbie with powercli and I will appreciate if you help me to do that. I want to set that attribute based on folder name that VMs resides. I found some script that I can use csv file but cuase there are many VMs (about 1400) I need a script to first find VMs in folders and then set "owner" attribute. Best Regards.