Solved

Exchange Build Version via Powershell

Posted on 2016-09-06
2
50 Views
Last Modified: 2016-09-06
Hi Experts,

I ask myself why
Get-ExchangeServer | Where-Object {$_.AdminDisplayVersion.Build -eq 847}

Open in new window

functions without problems but
switch (Get-ExchangeServer | Select-Object {$_.AdminDisplayVersion.Build})
{
    516 {"RTM-Version (Release to Manufacturing) von Exchange Server 2013 Release-Date: 03.12.12 "}
    847 {"Exchange Server 2013 SP1 Release-Date: 25.02.14 "}
    Default {"unknown Exchange build Number"}
}

Open in new window

does not function.

I suppose that  $_.AdminDisplayVersion.Build is an [INT32] (in my case '847'; switch function end alway in DEFAULT

thank you in anticipation
reredok
0
Comment
Question by:reredok
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41786260
You need to switch based on the values, not collection ..
Example..
Get-ExchangeServer | %{
switch ($_.AdminDisplayVersion.Build)
 {
    516 {"RTM-Version (Release to Manufacturing) von Exchange Server 2013 Release-Date: 03.12.12 "}
    847 {"Exchange Server 2013 SP1 Release-Date: 25.02.14 "}
    Default {"unknown Exchange build Number"}
 }
}

Open in new window

1
 
LVL 4

Author Closing Comment

by:reredok
ID: 41786279
thx
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question