Something i struggled with in the past is setting the productlocker, hassle with scripts and ssh and avoiding host reboots. Today we had to configure another 20 hosts with this and i was pointed to a solution doing it with the MOB. So my next thing was, how to automate this. And with 2 simple foreach loops you can set it and check it and be done!

Setting all hosts from a cluster with a specific path for the productlocker

$allhosts = get-cluster "clustername" | get-vmhost

foreach ($hostname in $allhosts){
Get-VMhost -Name $hostname | %{$_.ExtensionData.UpdateProductLockerLocation_Task("/vmfs/volumes/pathname")}
}

Query all hosts in a cluster to check what location is set

$allhosts = get-cluster "clustername" | get-vmhost

foreach ($hostname in $allhosts){
Get-VMhost -Name $hostname | %{$_.ExtensionData.QueryProductLockerLocation()}
Write-Host $hostname -ForegroundColor Green
}

The original article was posted on: www.hollebollevsan.nl

Related articles

  • Hybrid Cloud
  • Cloud Native
  • Dev Enablement
  • Platform Engineering
  • Implementation and Adoption
  • Digital Workspace
  • Application Management Services
  • Data Center Modernization
  • Managed Cloud Platform
  • Public Cloud Landing Zones
  • Sovereign Cloud
Visit our knowledge hub
Visit our knowledge hub
Paul van Dieën IT Consultant

Let's talk!

Knowledge is key for our existence. This knowledge we use for disruptive innovation and changing organizations. Are you ready for change?

"*" indicates required fields

First name*
Last name*
This field is hidden when viewing the form