Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Which 2008 clustered node is active via script

12 views
Skip to first unread message

Paul Bergson [MVP-DS]

unread,
Feb 20, 2009, 2:09:08 PM2/20/09
to
I need to be able to code a script in PowerShell, VBS or Perl to learn which
node is active. I have been unsuccessful so far in learning how to do this
on a Windows Server 2008 64 bit server, running Exchange 2007.

I have found references for pre-2008 and 2008-R2 looks like it will have
some nice cmdlets in it, but unfortunately that is in the future and I need
to learn how to do now.

Any references or code is appreciated.


--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.


Marco Shaw [MVP]

unread,
Feb 20, 2009, 2:45:57 PM2/20/09
to
Paul Bergson [MVP-DS] wrote:
> I need to be able to code a script in PowerShell, VBS or Perl to learn
> which node is active. I have been unsuccessful so far in learning how
> to do this on a Windows Server 2008 64 bit server, running Exchange 2007.
>
> I have found references for pre-2008 and 2008-R2 looks like it will have
> some nice cmdlets in it, but unfortunately that is in the future and I
> need to learn how to do now.
>
> Any references or code is appreciated.
>
>

I don't know how to set the reply-to so this only continues in one
particular group.

You need to run this locally (COM or even WMI) or remotely (WMI)?

I might be able to check this tomorrow if nobody else does before then.

Marco

Paul Bergson [MVP-DS]

unread,
Feb 20, 2009, 3:24:59 PM2/20/09
to
Locally. Everything I have tried so far has been stopped because I run on
server 2008.

--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.


"Marco Shaw [MVP]" <marco.shaw@NO_SPAMgmail.com> wrote in message
news:uQordP5k...@TK2MSFTNGP03.phx.gbl...

Missy Koslosky

unread,
Feb 20, 2009, 7:21:06 PM2/20/09
to
(follow-ups set to m.p.e.clustering)

Have you done a Get-MailboxDatabase -status | fl yet? I don't have an
exchange 2007 server around right this second, but there may well be an
attribute in the results that will give you the information you want.

Missy

"Paul Bergson [MVP-DS]" <pbbergs@nopspam_msn.com> wrote in message
news:EE8367FB-C1D3-49AB...@microsoft.com...

Shay Levy [MVP]

unread,
Feb 22, 2009, 3:45:51 AM2/22/09
to
Try cluster.exe

PS > CLUSTER <clusterName> GROUP <groupName> /STATUS


Listing status for resource group 'groupName':

Group Node Status
-------------------- --------------- ------
groupName nodeName Online

Or using WMI, this will get all groups active nodes:

PS> Get-WMIObject MSCluster_ResourceGroup -ComputerName clusterName -Namespace
root\mscluster | Format-Table Name,__Server


To filter a specific group name:

PS> Get-WMIObject MSCluster_ResourceGroup -ComputerName clusterName -Namespace
root\mscluster -filter "name='groupName'"| Format-Table Name,__Server

---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar


P> I need to be able to code a script in PowerShell, VBS or Perl to
P> learn which node is active. I have been unsuccessful so far in
P> learning how to do this on a Windows Server 2008 64 bit server,
P> running Exchange 2007.
P>
P> I have found references for pre-2008 and 2008-R2 looks like it will
P> have some nice cmdlets in it, but unfortunately that is in the future
P> and I need to learn how to do now.
P>
P> Any references or code is appreciated.
P>
P> http://www.pbbergs.com
P>
P> Please no e-mails, any questions should be posted in the NewsGroup
P> This posting is provided "AS IS" with no warranties, and confers no
P> rights.
P>


Ed Crowley [MVP]

unread,
Feb 22, 2009, 12:47:37 PM2/22/09
to
This will do it:

(Get-ClusteredMailboxServerStatus -Identity <CMS_Name>).OperationalMachines
| ForEach-Object {If ($_.Contains("Active")) {$ActiveNode = $_.Substring(0,
$_.IndexOf(" "))}}

$ActiveNode will have the name of the active node.
--
Ed Crowley MVP
"There are seldom good technological solutions to behavioral problems."
.

"Paul Bergson [MVP-DS]" <pbbergs@nopspam_msn.com> wrote in message
news:EE8367FB-C1D3-49AB...@microsoft.com...

Paul Bergson [MVP-DS]

unread,
Feb 23, 2009, 10:27:21 AM2/23/09
to
Spot on!!! Works perfectly.

Thanks!!!

--
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.


"Ed Crowley [MVP]" <curs...@nospam.net> wrote in message
news:ezwjlWRl...@TK2MSFTNGP03.phx.gbl...

A. User @ Work

unread,
Mar 4, 2009, 11:48:29 AM3/4/09
to
This is for PS - is there a way for VBScript?

"Ed Crowley [MVP]" <curs...@nospam.net> wrote in message
news:ezwjlWRl...@TK2MSFTNGP03.phx.gbl...

0 new messages