Change/Update DNS or domain with vSphere PowerCLI

There was some confusion on how to specify multiple dns server ip address or domain search names with the Set-VMHostNetwork cmdlet. Turns out is a simple comma separated list that get treated as a parameter array. Here is an example. Connect-viserver vCenterServerFQDNorIP $ESXiHosts = Get-VMHost foreach ($esx in $ESXiHosts) { Get-VMHostNetwork | Set-VmHostNetwork -DomainName eng.example.com … Read more

Add iSCSI send targets with vSphere PowerCLI

Here’s a quick how to add iSCSI send targets on all hosts in your VC Connect-viserver vCenterServerFQDNorIP $targets = “StorageTargetIP1”, “StorageTargetIP2” $ESXiHosts = Get-VMHost foreach ($esx in $ESXiHosts) { $hba = $esx | Get-VMHostHba -Type iScsi | Where {$_.Model -eq “iSCSI Software Adapter”} foreach ($target in $targets) { # Check to see if the SendTarget … Read more