Solved

Exchange Build Version via Powershell

Posted on 2016-09-06
2
41 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

Problems using Powershell and Active Directory?

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

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
To show how to generate a certificate request 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 Servers >> Certificates…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now