your home for end-user virtualization!

PowerCLI

Use PowerCLI to apply your vSAN storage policy

I  noticed that VM’s created with the vSphere fat client, were not getting the vSAN storage policy applied to them. So they we’re not as protected as one might think. I wanted to make sure that all the VM’s living on vSanDatastore were protected by the vSAN storage policy. I wrote a quick PowerCLI script […]

Posted in Automation, PowerCLI, vmware | No Comments »

Using PowerCLI to remotely execute esxcli commands

First, make sure you’re using a version of PowerCLI that supports the get-esxcli cmdlet. In this case, I used a fresh install of PowerCLI 5.5. First, get-esxcli needs to be run against a single host individually, you can loop through you’re hosts later, but again, one at a time. So I did: $getcli = Get-EsxCli […]

Tags: ,

Posted in esxcli, PowerCLI, Powershell, vmware | 1 Comment »

Finding orphaned VMDK’s using PowerCLI

Here is a PowerCLI script I use to find all orphaned VMDK’s in my vCenter environment. $arrayVC = “virtualcenter2” Foreach ($strVC in $arrayVC) { Connect-VIServer $strVC $arrUsedDisks = Get-VM | Get-HardDisk | %{$_.filename} $arrUsedDisks += get-template | Get-HardDisk | %{$_.filename} $arrDS = Get-Datastore Foreach ($strDatastore in $arrDS) { $strDatastoreName = $strDatastore.name $ds = Get-Datastore -Name […]

Tags: , ,

Posted in PowerCLI, Powershell, Virtualization, vmware | No Comments »

Configure Syslog on ESXi using PowerShell and PowerCLI

Using powershell, I was able to configure all the hosts in my vCenter instance First, I needed to configure the syslog host get-vmhost| Set-VMHostAdvancedConfiguration -NameValue @{‘Config.HostAgent.log.level’=’info’;’Vpx.Vpxa.config.log.level’=’info’;’Syslog.global.logHost’=’udp://IPADDDR:514′} I then needed to open the appropriate firewall ports for the traffic to get through get-vmhost| Get-VMHostFirewallException |?{$_.Name -eq ‘syslog’} | Set-VMHostFirewallException -Enabled:$true On the C220 M3’s, we had […]

Tags: , , ,

Posted in PowerCLI, Powershell, vmware | 1 Comment »

Search

Categories