Categories
PowerShell VMware vROPs

vROPs powershell module

If you would like to manage your vROPs using Powershell the following module could be helpful. Quote: PowervROps is a module written for PowerShell that can be used to access various elements of the vRealize Operations Manager API via PowerShell functions. Link: https://github.com/andydvmware/PowervROps

Categories
Scripts Uncategorized VMware vSphere

Get all guest IPs of all your Virtual Machines using Powershell

This is a small powershell script to get all Guest IPs from all virtual machines $VCENTER=”10.1.1.3″ Connect-VIServer -Server $VCENTER $vms = Get-VM | Sort $file = “c:\ip_list.txt” foreach ($vm in $vms){ foreach($ip in $vm.Guest.IpAddress){ Write-Host “$vm $ip” “$vm $ip” | Out-File -FilePath $file -Append } } Disconnect-VIServer -Server $VCENTER -Confirm:$false -Force:$true

Categories
PowerShell Scripts

Upload file to webdav using Powershell

This is small powershell script to upload a file from your local disk to a webdav server. It is also proxy capable. #Complete path of the file to be uploaded $file = “d:\test_file.txt” #URL without the last “/” $url = “https://YOUR-SERVER/webdav” $proxy = “http=PROXY-SERVER:PORT” #User and Pwd for Webdav Access $user = “USERNAME” $pass = […]

Categories
PowerShell

Change Linux User password using Powershell

Sounds strange but yes it is possible :-) Just one module and some lines of Powershell code and thats it. Import-Module SSH-Sessions $old_passwd = “vmware” $new_passwd = “VMware1!” New-SshSession -ComputerName IP-ADDRESS -Username admin -Password $old_passwd $result = Invoke-SshCommand -ComputerName IP-ADDRESS -Command “printf ‘%s\n’ $old_passwd $new_passwd $new_passwd | passwd” Write-Host $result Remove-SshSession -RemoveAll

Categories
ESXi PowerShell Scripts VMware vSphere

Collect ESXi stats with powershell and send it to Graphite server

I was not quite happy with the statistics from the vCenter. It is not possible to get an overview overall my ESXi servers. :-( Someone pointed me to the tool Graphite that this is a cool solution to visualize such kind of statistics. So I decided to give it a try. I created and virtual […]

Categories
ESXi Homelab HP Ideas PowerShell Scripts VMware vSphere

HomeLab and nested ESXi server

After an short weekend with a minimal of sleep … I’m done my Homelab is up and running. Furthermore I have created an template of an nested ESXi (virtualized ESXi). These nested ESXi are perfect for testing of Powershell scripts which I use to initial configure an new ESXi. Next steps which I have planned […]

Categories
PowerShell Scripts theVESI Virtualisation VMware vSphere

VMware Tools Status report

Script to create a report about the VMware Tools status: Sample Output: Total VMs: 527 Total powered on: 474 Total powered off: 53 ToolsOK: 140 ToolsOld: 227 ToolsNotInstalled: 106 DisConnect from Virtual Center Set-PSDebug -Strict $VIServer = “VCENTERIP” Connect-VIServer -server $VIServer -User USERNAME -Password PASSWORD $vms = Get-VM | Sort Name $on = 0 $toolsOk […]

Categories
PowerShell Scripts theVESI Virtualisation VMware vSphere

Get VM information as Script node for the Virtualization EcoShell

This script node will open a small window with a drop down menu with all your VM’s listed. Select one and click on OK. The script will collect some information and then display them. Script node: if ($global:defaultviservers) { #Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) […]

Categories
PowerShell Scripts

Count VMs ToolsOK | ToolsOld | ToolsNotInstalled

Connect-VIServer -server VCSERVER -User USER -Password PASSWORD $vms = Get-VM | Sort Name $on = 0 $toolsOk = 0 $toolsOld = 0 $toolsNotInstalled = 0 foreach ($vm in $vms){ if ($vm.PowerState -like “PoweredOn”){ $vmview = $vm | Get-View $toolsstatus = $vmview.Guest.ToolsStatus $toolsrunningstatus = $vmview.Guest.ToolsRunningStatus $toolsversionstatus = $vmview.Guest.ToolsVersionStatus $on = $on+1 if ($toolsstatus -like “toolsOk”){ $toolsOk […]

Categories
ESXi PowerShell Scripts Virtualisation VMware vSphere

Find VMs with Video Card Memory higher than 30MB

Connect-VIServer -server VCENTER -User USER -Password PASSWORD $vms = Get-VM foreach ($vm in $vms) { $vmview = $vm | Get-View foreach ($device in $vmview.config.hardware.device) { if ($device.Key -eq 500){ $test = $device.DeviceInfo.Summary $result = $device.videoRamSizeInKB if ($result -cgt 30000){ $mb = $result/1024 Write-Host $vm $result $mb } } } } Write-Host “Done”