{"id":1627,"date":"2009-06-12T10:31:34","date_gmt":"2009-06-12T15:31:34","guid":{"rendered":"http:\/\/www.bhargavs.com\/?p=103"},"modified":"2009-06-12T10:31:34","modified_gmt":"2009-06-12T15:31:34","slug":"check-exchange-2003-vitals-powershell","status":"publish","type":"post","link":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","title":{"rendered":"Check Exchange 2003 vitals with PowerShell \u2013 Part II"},"content":{"rendered":"<p>In continuation to my previous post <a href=\"http:\/\/www.bhargavs.com\/index.php\/exchange-server\/2009\/06\/check-exchange-2003-vitals-powershell-2\/\">\u201cCheck Exchange 2003 vitals with PowerShell\u201d<\/a>, I also have a code block that you can replace if you want to query all exchange servers in your environment dynamically with script instead of using text file as in the code I posted earlier.<\/p>\n<p>In the code I posted earlier, the following lines read the file servers.txt.<\/p>\n<pre lang=\"PowerShell\" line=\"1\"># Read file and store server names in variable\n\n$Servers = (Get-Content .\\servers.txt)<\/pre>\n<p>Replace it with the following, which queries Active Directory for objectclass msExchExchangeServer and returns all servers found.<\/p>\n<pre lang=\"PowerShell\" escaped=\"true\" line=\"1\"># Get Exchange Servers from Active Directory\n\nfunction GetExchangeServers()\n{\n\t# Set variables to connect to Active Directory, searching Configuration Naming Context\n\t$root= New-Object System.DirectoryServices.DirectoryEntry(&quot;LDAP:\/\/RootDSE&quot;)\n\t$configpartition = [adsi](&quot;LDAP:\/\/CN=Microsoft Exchange,CN=Services,&quot; + $root.configurationNamingContext)\n\n\t# Set variables for search criteria\n\t$search = New-Object System.DirectoryServices.DirectorySearcher($configpartition)\n\t$search.filter = '(objectclass=msExchExchangeServer)'\n\n\t# Perform Serach, this will return all Exchange Server objects\n\t$ExchServer = $search.FindAll()\n\n\t# Output Name property of each server object stored in ExchServer array\n\t$ExchServer | foreach {$_.properties.name}\n\n\t# Comment the line above and uncomment the line below if you want to search specific Exchange servers by name\n\t# The example filter below will only output servers that have MBX in their name (i.e. MBX01, SRVMBX45 etc.)\n\t#$ExchServer | foreach {$_.properties.legacyexchangedn -match &quot;MBX&quot;}\n}<\/pre>\n<p>You will also have to replace the lines:<\/p>\n<pre lang=\"PowerShell\" line=\"1\"># Get vitals for each server stored in $Servers array\n$Servers | %{getVitals}<\/pre>\n<p>with the following:<\/p>\n<pre lang=\"PowerShell\" line=\"1\"># Get vitals for each server stored in $Servers array\nGetExchangeServers | %{getVitals}<\/pre>\n<p>\n  <br \/>Comments welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In continuation to my previous post \u201cCheck Exchange 2003 vitals with PowerShell\u201d, I also have a code block that you can replace if you want to query all exchange servers [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[50,40,19],"tags":[120,212],"class_list":["post-1627","post","type-post","status-publish","format-standard","hentry","category-exchange-2003","category-exchange-server","category-powershell","tag-exchange-2003","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Check Exchange 2003 vitals with PowerShell \u2013 Part II - Bhargav&#039;s IT Playground<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Check Exchange 2003 vitals with PowerShell \u2013 Part II - Bhargav&#039;s IT Playground\" \/>\n<meta property=\"og:description\" content=\"In continuation to my previous post \u201cCheck Exchange 2003 vitals with PowerShell\u201d, I also have a code block that you can replace if you want to query all exchange servers [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Bhargav&#039;s IT Playground\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-12T15:31:34+00:00\" \/>\n<meta name=\"author\" content=\"Bhargav\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhargav\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/\"},\"author\":{\"name\":\"Bhargav\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"headline\":\"Check Exchange 2003 vitals with PowerShell \u2013 Part II\",\"datePublished\":\"2009-06-12T15:31:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/\"},\"wordCount\":98,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"keywords\":[\"Exchange 2003\",\"PowerShell\"],\"articleSection\":[\"Exchange 2003\",\"Exchange Server\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/\",\"name\":\"Check Exchange 2003 vitals with PowerShell \u2013 Part II - Bhargav&#039;s IT Playground\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\"},\"datePublished\":\"2009-06-12T15:31:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bhargavs.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Check Exchange 2003 vitals with PowerShell \u2013 Part II\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/\",\"name\":\"Bhargav's IT Playground\",\"description\":\"Passion for Technology. Power of Collaboration.\",\"publisher\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bhargavs.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\",\"name\":\"Bhargav\",\"logo\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/bhargavs.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Check Exchange 2003 vitals with PowerShell \u2013 Part II - Bhargav&#039;s IT Playground","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Check Exchange 2003 vitals with PowerShell \u2013 Part II - Bhargav&#039;s IT Playground","og_description":"In continuation to my previous post \u201cCheck Exchange 2003 vitals with PowerShell\u201d, I also have a code block that you can replace if you want to query all exchange servers [&hellip;]","og_url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","og_site_name":"Bhargav&#039;s IT Playground","article_published_time":"2009-06-12T15:31:34+00:00","author":"Bhargav","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bhargav","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/#article","isPartOf":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/"},"author":{"name":"Bhargav","@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"headline":"Check Exchange 2003 vitals with PowerShell \u2013 Part II","datePublished":"2009-06-12T15:31:34+00:00","mainEntityOfPage":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/"},"wordCount":98,"commentCount":0,"publisher":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"keywords":["Exchange 2003","PowerShell"],"articleSection":["Exchange 2003","Exchange Server","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","name":"Check Exchange 2003 vitals with PowerShell \u2013 Part II - Bhargav&#039;s IT Playground","isPartOf":{"@id":"https:\/\/bhargavs.com\/#website"},"datePublished":"2009-06-12T15:31:34+00:00","breadcrumb":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bhargavs.com\/"},{"@type":"ListItem","position":2,"name":"Check Exchange 2003 vitals with PowerShell \u2013 Part II"}]},{"@type":"WebSite","@id":"https:\/\/bhargavs.com\/#website","url":"https:\/\/bhargavs.com\/","name":"Bhargav's IT Playground","description":"Passion for Technology. Power of Collaboration.","publisher":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bhargavs.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26","name":"Bhargav","logo":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/bhargavs.com"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":97,"url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/","url_meta":{"origin":1627,"position":0},"title":"Check Exchange 2003 vitals with PowerShell","author":"Bhargav","date":"June 12, 2009","format":false,"excerpt":"I have written recently about Free System PTEs and \/PAE usage in Exchange 2003 mailbox servers. I set out to write a PowerShell script that will run against given list of servers and report back certain vitals including boot.ini settings, SystemPages registry setting and current performance data for Free Sytem\u2026","rel":"","context":"In &quot;Exchange 2003&quot;","block_context":{"text":"Exchange 2003","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2003\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1651,"url":"https:\/\/bhargavs.com\/index.php\/2010\/04\/07\/how-to-install-update-rollups-remotely-on-exchange-2010-server\/","url_meta":{"origin":1627,"position":1},"title":"How to install Update Rollups remotely on Exchange 2010 server","author":"Bhargav","date":"April 7, 2010","format":false,"excerpt":"If you are like me, you are always looking for ways to not leave your chair, or for that matter, not switch windows. When it comes to install Update Rollups on every Exchange 2010 server you have, the same applies. So I set out to find a way and I\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1628,"url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/windows-server-corrupt-missing-performance-counters\/","url_meta":{"origin":1627,"position":2},"title":"Corrupt or Missing Performance Counters","author":"Bhargav","date":"June 12, 2009","format":false,"excerpt":"One of the functions in the code I posted in \u201cCheck Exchange 2003 vitals with PowerShell\u201d is to check performance counters. When running the script, you may encounter an error: Get-WmiObject : Invalid Class \u00a0 This could happen for 2 reasons: 1: You have a typo in Perf Counter object.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1648,"url":"https:\/\/bhargavs.com\/index.php\/2010\/03\/25\/script-to-suppress-link-state-updates\/","url_meta":{"origin":1627,"position":3},"title":"Script to suppress Link State Updates","author":"Bhargav","date":"March 25, 2010","format":false,"excerpt":"If you are in process of upgrading from Exchange 2003 to Exchange 2010, you must have read \u201cUpgrade from Exchange 2003 Transport\u201d article on Technet which spells out the details of a requirement - \u201cminor link state updates must be suppressed to make sure that message looping doesn't occur when\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1679,"url":"https:\/\/bhargavs.com\/index.php\/2012\/05\/03\/exchange-management-shell-error-500-internal-server-error\/","url_meta":{"origin":1627,"position":4},"title":"Exchange Management Shell Error 500 &#8211; Internal Server Error","author":"Bhargav","date":"May 3, 2012","format":false,"excerpt":"I have come across this issue enough times that even if it is documented on TechNet it deserves mention here. When you launch Exchange Management Shell or try to connect to an Exchange 2010 Server remotely using PowerShell, you get error \u201c500 \u2013 Internal Server Error. There is a problem\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":81,"url":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/","url_meta":{"origin":1627,"position":5},"title":"Force Mount-Database","author":"Bhargav","date":"May 28, 2009","format":false,"excerpt":"I wanted to mount All mailbox databases from all servers that had them. This was a scenario where I had servers recovered with no DB files. I did not need them, I was going to start with empty databases. The command was going to be simple: Get-MailboxDatabase | Mount-Database -Confirm:$false\u2026","rel":"","context":"In &quot;Exchange 2007&quot;","block_context":{"text":"Exchange 2007","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2007\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pkROc-qf","_links":{"self":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/1627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/comments?post=1627"}],"version-history":[{"count":0,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/1627\/revisions"}],"wp:attachment":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/media?parent=1627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/categories?post=1627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/tags?post=1627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}