{"id":97,"date":"2009-06-12T09:09:51","date_gmt":"2009-06-12T14:09:51","guid":{"rendered":"http:\/\/www.bhargavs.com\/index.php\/technology\/2009\/06\/check-exchange-2003-vitals-powershell\/"},"modified":"2009-06-12T09:09:51","modified_gmt":"2009-06-12T14:09:51","slug":"check-exchange-2003-vitals-powershell-2","status":"publish","type":"post","link":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/","title":{"rendered":"Check Exchange 2003 vitals with PowerShell"},"content":{"rendered":"<p>I have written recently about Free System PTEs and \/PAE usage in Exchange 2003 mailbox servers.<\/p>\n<p>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 PTEs and Pool Non-Paged Bytes.<\/p>\n<p>&#160;<\/p>\n<p>The output csv can be used as a checkpoint for server health and can be used for reporting matrix. The script can easily be modified to add more performance counters and registry checks as necessary.<\/p>\n<p>&#160;<\/p>\n<pre lang=\"PowerShell\" escaped=\"true\" line=\"1\"># Read file and store server names in variable\n\n$Servers = (Get-Content .\\servers.txt)\n\n# Write header in output file\n\n# Store header in variable\n$headerLine =\n@&quot;\n\nServer Name,Boot String,3GB,PAE,UserVA,Basevideo,SystemPages,Free System PTEs, Pool Non-Paged Bytes\n&quot;@\n\n# Write header to file\n$headerLine | Out-File .\\results.csv -Encoding ASCII -Append\n\nfunction getVitals()\n\n{\n\t# Set server to connect to\n\t$Server = &quot;$_&quot;\n\n# Read SystemPages from servers\n\n\t# Set Registry Key variables\n\t$REG_KEY = &quot;System\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Memory Management&quot;\n\t$VALUE = &quot;SystemPages&quot;\n\n\t# Open remote registry\n\t$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Server)\n\n\t# Open the targeted remote registry key\/subkey\n\t$regKey= $reg.OpenSubKey($REG_KEY)\n\n\t# Read and Store SystemPages value in variable\n\t$SystemPages = $regkey.getvalue($VALUE)\n\n\t# Close the Reg Key\n\t$regKey.Close()\n\n# Read Boot.ini from Servers\n\n\t# Store Boot.ini contents in variable\n\t$iniContent = Get-Content &quot;\\\\$Server\\c$\\boot.ini&quot;\n\n\t# Store Boot string and values in variables\n\t$bootString = $iniContent[4] -replace &quot;,&quot;,&quot; &quot;\n\t$userva = ($bootString -split &quot; &quot; | foreach {if ($_ -match &quot;userva&quot;) {$_}} | foreach {$_ -replace &quot;\/userva=&quot;,&quot;&quot;})\n\n\tif ($iniContent[4] -match &quot;3gb&quot;) {$3gb=&quot;Present&quot;} else {$3gb=&quot;Missing&quot;}\n\tif ($iniContent[4] -match &quot;PAE&quot;) {$pae=&quot;Present&quot;} else {$pae=&quot;Missing&quot;}\n\tif ($iniContent[4] -match &quot;basevideo&quot;) {$basevideo=&quot;Present&quot;} else {$userva=&quot;Missing&quot;}\n\n# Read System Pages and NPP values from Performance Counters\n\n\t# Read performance counters\n\t$freeSPTEs = (Get-WmiObject Win32_PerfFormattedData_PerfOS_Memory -ComputerName $Server).FreeSystemPageTableEntries\n\t$poolNPBytes = (Get-WmiObject Win32_PerfFormattedData_PerfOS_Memory -ComputerName $Server).PoolNonPagedBytes\n\n# Write data to file\n\n\t# Store result string in a variable\n\t$result = &quot;$Server,$bootString,$3gb,$pae,$userva,$basevideo,$SystemPages,$freeSPTEs,$poolNPBytes&quot;\n\n\t# Write results to file\n\t$result | Out-File .\\results.csv -Encoding ASCII -Append\n\n}\n\n\n# Get vitals for each server stored in $Servers array\n$Servers | %{getVitals}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 [&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-97","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.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Check Exchange 2003 vitals with PowerShell - 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-2\/\" \/>\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 - Bhargav&#039;s IT Playground\" \/>\n<meta property=\"og:description\" content=\"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 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Bhargav&#039;s IT Playground\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-12T14:09:51+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=\"2 minutes\" \/>\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-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/\"},\"author\":{\"name\":\"Bhargav\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"headline\":\"Check Exchange 2003 vitals with PowerShell\",\"datePublished\":\"2009-06-12T14:09:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/\"},\"wordCount\":95,\"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-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/\",\"name\":\"Check Exchange 2003 vitals with PowerShell - Bhargav&#039;s IT Playground\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\"},\"datePublished\":\"2009-06-12T14:09:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/06\\\/12\\\/check-exchange-2003-vitals-powershell-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bhargavs.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Check Exchange 2003 vitals with PowerShell\"}]},{\"@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 - 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-2\/","og_locale":"en_US","og_type":"article","og_title":"Check Exchange 2003 vitals with PowerShell - Bhargav&#039;s IT Playground","og_description":"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 [&hellip;]","og_url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/","og_site_name":"Bhargav&#039;s IT Playground","article_published_time":"2009-06-12T14:09:51+00:00","author":"Bhargav","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bhargav","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/#article","isPartOf":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/"},"author":{"name":"Bhargav","@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"headline":"Check Exchange 2003 vitals with PowerShell","datePublished":"2009-06-12T14:09:51+00:00","mainEntityOfPage":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/"},"wordCount":95,"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-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/","url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/","name":"Check Exchange 2003 vitals with PowerShell - Bhargav&#039;s IT Playground","isPartOf":{"@id":"https:\/\/bhargavs.com\/#website"},"datePublished":"2009-06-12T14:09:51+00:00","breadcrumb":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bhargavs.com\/"},{"@type":"ListItem","position":2,"name":"Check Exchange 2003 vitals with PowerShell"}]},{"@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":1627,"url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","url_meta":{"origin":97,"position":0},"title":"Check Exchange 2003 vitals with PowerShell \u2013 Part II","author":"Bhargav","date":"June 12, 2009","format":false,"excerpt":"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 in your environment dynamically with script instead of using text file as in the code I posted earlier. In the\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":1624,"url":"https:\/\/bhargavs.com\/index.php\/2009\/02\/25\/free-system-page-table-entries-in-exchange-2003\/","url_meta":{"origin":97,"position":1},"title":"Free System Page Table Entries in Exchange 2003","author":"Bhargav","date":"February 25, 2009","format":false,"excerpt":"When troubleshooting performance of Exchange 2003, most overlooked performance counter is Free System PTEs. Very simply put PTE is basically an I\/O partition table. Why is PTE important? If a system is running out of PTEs, it can cause system hangs, sporadic lockups, general unresponsiveness. All is bad for a\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":58,"url":"https:\/\/bhargavs.com\/index.php\/2009\/02\/25\/pae-exchange-2003-servers\/","url_meta":{"origin":97,"position":2},"title":"Why should I use \/PAE on my Exchange 2003 servers?","author":"Bhargav","date":"February 25, 2009","format":false,"excerpt":"Many times I come across the configurations where the servers physically have 4GB memory installed but OS does not see it all. OS usually reports between 512 to 768 MB less! Running Exchange 2003 on such server with recommended memory tuning parameters as documented in my previous post, makes it\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":1628,"url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/windows-server-corrupt-missing-performance-counters\/","url_meta":{"origin":97,"position":3},"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":211,"url":"https:\/\/bhargavs.com\/index.php\/2009\/12\/14\/how-do-i-check-update-rollup-version-on-exchange-20xx-server\/","url_meta":{"origin":97,"position":4},"title":"How do I check Update Rollup version on Exchange 20xx Server?","author":"Bhargav","date":"December 14, 2009","format":false,"excerpt":"UPDATED: Feb 26, 2014, updated script to accommodate Exchange 2013 Now that Update Rollup for Exchange Server 2010 is available, I have updated my previous script to check for Update Rollup versions on both Exchange Server 2007 and Exchange Server 2010. No need to have two versions of script. Just\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":[]},{"id":1648,"url":"https:\/\/bhargavs.com\/index.php\/2010\/03\/25\/script-to-suppress-link-state-updates\/","url_meta":{"origin":97,"position":5},"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":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pkROc-1z","_links":{"self":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/97","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=97"}],"version-history":[{"count":0,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}