vamsiveldi
Contributor
Contributor

Run pCLI command against vCenter/Datacenter.

Hi All,

Need help in modifying below script to run against vCenter/data center.

# Begin variables

$VC1 = "XXXXX"

$cluster = "zzStaging"

# End variables

# Connect to vCenter server

Connect-VIServer "$VC1"

$vmhosts = Get-Cluster $cluster | Get-VMhost

foreach($vmhost in $vmhosts)

{

    #Set VMFS3.HardwareAcceleratedLocking value to 0

    Set-VMHostAdvancedConfiguration -Name VMFS3.HardwareAcceleratedLocking -Value 0 -VMHost $vmhost  

   

}

# Disconnect from vCenter server

Disconnect-VIServer -server "$VC1" -Force -Confirm:$false

Thank you,

Vamsi.

0 Kudos
1 Reply
oschroeder8
Contributor
Contributor

Wouldn't this work?

$vmhosts = Get-VMhost


That lists all the hosts for that vCenter.

0 Kudos