Hello,
I'm trying to get this to run only on one Cluster, currently I have it running on a single host, but would like to get it to work on a specific Cluster.
get-vmhost host1.lab.local | get-view).EnterLockdownMode() | get-vmhost | select Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}} | ft -auto Name LockDown
I have tried this but getting this error message:
(Get-Cluster "Local" | get-view).EnterLockdownMode() | get-vmhost | select Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}} | ft -auto Name LockDown
Error Message
Method invocation failed because [VMware.Vim.ClusterComputeResource] doesn't contain a method named 'EnterLockdownMode'.
At line:1 char:51
+ (Get-Cluster "Local" | get-view).EnterLockdownMode <<<< () | get-vmhost | sel
ect Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}} | ft -auto N
ame LockDown
+ CategoryInfo : InvalidOperation: (EnterLockdownMode:String) [],
RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
How can I run this for only one cluster and not the other clusters.
Thanks,
Mike
Try something like this
Get-Cluster local | Get-VMHost | %{
(get-view $_).EnterLockdownMode()
$_ | select Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}}
} | ft -auto
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Get-Cluster local | Get-VMHost | %{
(get-view $_).EnterLockdownMode()
$_ | select Name,@{N="LockDown";E={$_.Extensiondata.Config.adminDisabled}}
} | ft -auto
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD, I was able to get it to work perrfect.
Take Care,
-Mike