What happens if you run this (I would check myself but we don’t use clusters):
(Get-CauClusterRole -Cluster PHAMSCLUST14).name.DaysOfWeek
--
John Wright
IT Support Specialist
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Mike Leone
Sent: Thursday, March 21, 2024 11:24 AM
To: NTPowershell Mailing List <ntpowe...@googlegroups.com>
Subject: [ntpowershell] Q about Get-CauClusterRole
This message is from an external sender. |
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2Bhf4ezAN9e%2BAZ-nJOWkGW6YypmQaKYE2xFD%3D6a4Nnip1Q%40mail.gmail.com.
[CAUTION] Do not click on links or open attachments unless you recognize the sender and know the content is safe. |
It’s probably a hash table. But I also don’t have a cluster handy to check.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/DM6PR12MB4372B2702C725795F76D4D0791322%40DM6PR12MB4372.namprd12.prod.outlook.com.
What happens if you run this (I would check myself but we don’t use clusters):
(Get-CauClusterRole -Cluster PHAMSCLUST14).name.DaysOfWeek
It’s probably a hash table. But I also don’t have a cluster handy to check.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/2d8bddcb82714c48b75d1a931eb4ed49%40smithcons.com.
Pure guess:
$CAU = Get-CauClusterRole -Cluster PHAMSCLUST17
$CAU[ 'DaysOfWeek' ]
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2BjN1K9MV0z8Qqm7%3DrEYkQeYyVWrshX6Webw_hRqRYNSLw%40mail.gmail.com.
For giggles, I tried executing the splat and subsequent command. The blue information bar has the following while failing to connect to an actual cluster:
Setting properties for CAU clustered role on cluster "System.Collections.Hashtable"
Try the following:
$Parameters = @{
ClusterName = “YourClusterName”
DaysOfWeek = “YourDay”
WeeksOfMonth = “YourWeeksOfMonth”
RebootTimeoutMinutes = “YaKnowWhatToDoByNow”
Force = $true
}
$Result = Set-CauClusterRole @ Parameters
$Result.DaysOfWeek
Does this give you what you need?
Also, I’m surprised this won’t get you the info you need…
( Get-CauClusterRole -Cluster PHAMSCLUST14 ).DaysOfWeek
( Get-CauClusterRole -Cluster PHAMSCLUST14 ).WeeksOfMonth
At the very least it should return the values for those parameters for that cluster. As with others, I don’t have clusters so I cannot test that. However, I did test it with other commands using splats.
Later,
Matt Helton
(he/him/his)
Assistant System Administrator
Library Information Technology Services
Milner Library, Room 177
Illinois State University
Office: 309-438-2876
Help Desk: 309-438-8399
Help E-mail: librar...@ilstu.edu
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Mike Leone
Sent: Thursday, March 21, 2024 13:35
To: ntpowe...@googlegroups.com
Subject: Re: [ntpowershell] Q about Get-CauClusterRole
This message originated from outside of the Illinois State University email system. Learn why this is important |
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2BjN1K9MV0z8Qqm7%3DrEYkQeYyVWrshX6Webw_hRqRYNSLw%40mail.gmail.com.
Formatting fail caused a space between ‘@’ and ‘Parameters’. There should be no space between those two.
Matt Helton
(he/him/his)
Assistant System Administrator
Library Information Technology Services
Milner Library
Illinois State University
From: 'Helton, Matt' via ntpowershell <ntpowe...@googlegroups.com>
Sent: Thursday, March 21, 2024 13:53
To: ntpowe...@googlegroups.com
Subject: RE: [ntpowershell] Q about Get-CauClusterRole
This message originated from outside of the Illinois State University email system. Learn why this is important |
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CH0PR03MB59881668A7CA7F724C12CA27AA322%40CH0PR03MB5988.namprd03.prod.outlook.com.
For giggles, I tried executing the splat and subsequent command. The blue information bar has the following while failing to connect to an actual cluster:
Setting properties for CAU clustered role on cluster "System.Collections.Hashtable"
Try the following:
$Parameters = @{
ClusterName = “YourClusterName”
DaysOfWeek = “YourDay”
WeeksOfMonth = “YourWeeksOfMonth”
RebootTimeoutMinutes = “YaKnowWhatToDoByNow”
Force = $true
}
$Result = Set-CauClusterRole @ Parameters
$Result.DaysOfWeek
Does this give you what you need?
Also, I’m surprised this won’t get you the info you need…
( Get-CauClusterRole -Cluster PHAMSCLUST14 ).DaysOfWeek
( Get-CauClusterRole -Cluster PHAMSCLUST14 ).WeeksOfMonth
At the very least it should return the values for those parameters for that cluster. As with others, I don’t have clusters so I cannot test that. However, I did test it with other commands using splats.
Pure guess:
$CAU = Get-CauClusterRole -Cluster PHAMSCLUST17
$CAU[ 'DaysOfWeek' ]
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/5b26fc9df84f44b69faa631c66600570%40smithcons.com.
Try something just a little different from what you’ve already done and send us the output:
$CAU = Get-CauClusterRole -Cluster PHAMSCLUST17
gm -I $CAU
This will prevent the array unrolling that I think happened in your initial posting.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2BhT%3DaW29LMCV7%3DuRT-49bO7GKtO9_YOwpNNnGbKctKvfQ%40mail.gmail.com.
Try something just a little different from what you’ve already done and send us the output:
$CAU = Get-CauClusterRole -Cluster PHAMSCLUST17
gm -I $CAU
This will prevent the array unrolling that I think happened in your initial posting.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/9463e178b95d4cd1a4c50326bd40592e%40smithcons.com.
Ok it’s just a simple array. So you have to iterate through it:
$CAU = Get-CauClusterRole -Cluster PHAMSCLUST17
foreach( $item in $CAU ) {
$item.Name + ' = ' + $item.Value
}
Not a very efficient implementation.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2BipfrE83ujW9RoKb1iq8kVbkQAUCpOPH0NgxD63A7kAxA%40mail.gmail.com.