{"id":1081,"date":"2012-11-06T10:00:03","date_gmt":"2012-11-06T15:00:03","guid":{"rendered":"http:\/\/enterpriseadmins.org\/blog\/?p=1081"},"modified":"2012-11-02T09:41:53","modified_gmt":"2012-11-02T13:41:53","slug":"verify-root-password-on-a-group-of-hosts","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/scripting\/verify-root-password-on-a-group-of-hosts\/","title":{"rendered":"Verify root password on a group of hosts"},"content":{"rendered":"<p>I recently received several existing ESX hosts to support.  As part of the transition I received the root password used by all of the hosts.  I wanted to verify that the password I had was correct, so I threw together a quick script.  You may notice below that the password had a dollar sign in it, which as you may know is a special character in powershell so it needed to be escaped with a back tick.  <\/p>\n<pre><code class=\"language-powershell\">\r\n$esxHosts = \"esxi01.test.local\",\"esxi02.test.local\"\r\n$esxHosts += \"esxi03.test.local\",\"esx04.test.local\"\r\n$esxHosts += \"esx05.test.local\",\"esxi06.test.local\"\r\n\r\n$esxHosts |%{\r\n  $hostName = $_\r\n  $connection = Connect-Viserver $_ -user root -password \"pa`$`$w0rd\" -ea:0\r\n  New-Object PSObject -Property @{\r\n    Name=$hostName\r\n    IsConnected=$connection.IsConnected\r\n    VMCount = (Get-VM).Count\r\n  }#end psobject\r\n  Disconnect-viserver * -confirm:$false\r\n}#end host loop\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I recently received several existing ESX hosts to support. As part of the transition I received the root password used by all of the hosts. I wanted to verify that the password I had was correct, so I threw together &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/scripting\/verify-root-password-on-a-group-of-hosts\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-1081","post","type-post","status-publish","format-standard","hentry","category-scripting","category-virtualization"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=1081"}],"version-history":[{"count":4,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1081\/revisions"}],"predecessor-version":[{"id":1109,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1081\/revisions\/1109"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=1081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=1081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}