Posts

Showing posts from 2014

Some VMWare PowerCLI scripts that may come in handy to someone.

I was working with making some custom Scripts in PowerGUI and found some of the community ones missing some of the common things I have to do as part of Hardening or system setup. Most of the ones on other sites work but did not work well in PowerGUI due to it bombing out on an error so I just wanted it to set the ones which where not in the state I wanted them in. Status of Lockdown Mode Get-VMHost | Select Name, @{N="Lockdown";E={$_.Extensiondata.Config.adminDisabled}} Disable Lockdown Mode $Scope = Get-VMHost | Where {$_.Extensiondata.Config.adminDisabled -match 'True'} foreach ($ESXhost in $Scope) { (Get-VMHost $ESXhost | get-view).ExitLockdownMode() } Enable Lockdown Mode $Scope = Get-VMHost | Where {$_.Extensiondata.Config.adminDisabled -match 'False'} foreach ($ESXhost in $Scope) {  Get-VMHost $ESXhost | get-view).EnterLockdownMode() } I also wrote a few scripts to help set up hosts for our Flash storage as recommended by Pure f