vROPs powershell module

Categories: PowerShell, VMware, vROPs

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

Upload file to webdav using Powershell

Categories: PowerShell, Scripts

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 = […]

Change Linux User password using Powershell

Categories: 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

Change HA settings for virtual machines using Powershell

Categories: PowerShell, Scripts, VMware, vSphere

Using this small script it is possible to change the HA settings for multiple virtual machines in an HA cluster. Example: – multiple virtual machines all with Name XXX-console HA restart policy possible values: -HARestartPriority:Low -HARestartPriority:High -HARestartPriority:Disabled -HARestartPriority:Medium -HARestartPriority:ClusterRestartPriority Connect-VIServer -Server VCENTER-IP -User USER -Password PASSWORD $Cluster = “CLUSTERNAME” $vms = Get-VM -Location $Cluster -Name […]

Configure local syslog folder on all your ESXi servers

Categories: ESXi, PowerShell, Scripts, Virtualisation, VMware, vSphere

######################################################################################################## # Steps to use the script: # # 1st: create a folder on an shared datastore # # 2nd: adjust the content of the variable $FolderName to the name of the folder created in step 1 # # 3rd: adjust the content of the variable $datastore to the name of the shared datastore # […]

VMware Tools Status report

Categories: PowerShell, Scripts, theVESI, Virtualisation, VMware, vSphere

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 […]

Show WWN of FC devices

Categories: ESXi, PowerShell, Scripts, theVESI, Virtualisation, VMware, vSphere

First you need to connect to a vCenter: Connect-VIServer -Server VCENTERIP -User USERNAME -Password PASSWORD Get-VMHost | Sort | Select Name, @{N=”FC Device”;E={[string]::Join(“,”,(($_ | Get-View).Config.StorageDevice.HostBusAdapter | where{$_.GetType().Name -eq “HostFibreChannelHba”} | %{$_.Device}))}}, @{N=”FC WWN”;E={[string]::Join(“,”,(($_ | Get-View).Config.StorageDevice.HostBusAdapter | where{$_.GetType().Name -eq “HostFibreChannelHba”} | %{“{0:x}” -f $_.NodeWorldWideName}))}} Disconnect-VIServer -Server VCENTERIP -Force -Confirm:$false