I'm working with Powershell for a few days now - It's totally new to me (I know you already heard that so many times before... :-)).
I already have the base of my script - But now I have to do the following:
I have a text-file / logfile that looks like this (as you can see - I'm using PowerCLI from VMware, but I think this is a general Powershell question :-)):
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
Level
---- --------- ---------- ---------- ------------------
cluster1 True 1 True FullyAutomated
cluster2 True 1 False FullyAutomated
cluster3 False 1 False FullyAutomated
123442 True 1 False FullyAutomated
server23 True 0 False FullyAutomated
test123 False 1 False FullyAutomated
abcd False 1 False FullyAutomated
I think we have to cut off all the lines which are not necessary for the script?! - This will be the first 5 lines of the logfile and the stuff behind the cluster-names.
The next step will be to fill up a variable with the names of the clusters (in the first column) - I think this must be done in a loop?!
The script should be flexible so I will run a special command for each server / cluster:
function disableesxhostmonitoring {
# Disable the Cluster-Option "Host Monitoring"
$spec = New-Object VMware.Vim.ClusterConfigSpecEx
$spec.dasConfig = New-Object VMware.Vim.ClusterDasConfigInfo
$spec.dasConfig.hostMonitoring = "disabled"
$_this = Get-Cluster $vmcluster | Get-View
$_this.ReconfigureComputeResource_Task($spec, $true)
}
I hope someone can help.
Thanks
This post has been edited by HØLLØW: 25 October 2011 - 02:58 PM



Help

Back to top










