Solved

Exchange Build Version via Powershell

Posted on 2016-09-06
2
66 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ready to trade in that old firewall?

Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!

Question has a verified solution.

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

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…
This video discusses moving either the default database or any database to a new volume.
Suggested Courses

617 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