Solved

Exchange Build Version via Powershell

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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Suggested Solutions

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In this video we show how to create a Contact 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 >> Contact ta…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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