2013-01-13 48 views
0

我在使用PURE WMI(而不是本地命令行程序)來實現此目標很有趣。powershell wmi集羣資源私有屬性

$測試= gwmi -q 「SELECT * FROM MSCluster_resource」 - 命名空間根\ mscluster -computername myCluster中-Authentication數據包保密

說我挑選基於索引

$測試[32] .privateproperties一個資源

所有的資源都得到;設置和我用wbemtest證實了這一點。 但它們是MSCluster_Property的一部分。

如何通過wmi進行設置,因爲.privateproperties.put()不是可用的方法。

我已閱讀此內容,但不知道如何將其應用於PowerShell。 http://blogs.msdn.com/b/clustering/archive/2010/07/14/10037894.aspx

再次,不尋找本地commandlet或使用mscluster com。我用盡了谷歌。

回答

0

未經測試,但如果您只是分配新值,該怎麼辦?或者使用SetPropertyValue方法?

$test[32].PrivateProperties.SetPropertyValue(string propertyName, System.Object propertyValue) 
+0

它似乎不會持續... – rismoney