{"id":424,"date":"2008-08-22T00:00:00","date_gmt":"2008-08-22T00:00:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/top-tips-for-exchange-admins\/"},"modified":"2024-08-30T09:58:08","modified_gmt":"2024-08-30T09:58:08","slug":"top-tips-for-exchange-admins","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/sysadmin\/general\/top-tips-for-exchange-admins\/","title":{"rendered":"Top Tips for Exchange Admins"},"content":{"rendered":"<div id=\"pretty\">\n<p><b>Top Tips for Exchange Admins<\/b><\/p>\n<p>Our top tips competition this month have been dominated by one man, an admin of rare enthusiasm.<\/p>\n<p>Ben Lye of <a href=\"http:\/\/www.mathworks.co.uk\/\">The MathWorks<\/a> has sent us 3 tips this week, and these are as follows.<\/p>\n<hr \/>\n<p>In the spirit of the <a href=\"http:\/\/en.beijing2008.cn\/\">Olympics<\/a>&#8230;.the Gold goes to&#8230;.<\/p>\n<p><span class=\"rvts13\"><b>Disabling PST files &#8211; <\/b><b><\/b>straightforward I know, but this is something every admin should do. The effort this takes, vs. the effort it could save, means we have a clear victor. Ben writes&#8230;.<\/span><\/p>\n<p><span class=\"rvts13\"><i>&#8220;Microsoft Outlook supports a couple of options for restricting PST files. &#160;The first is a registry change called PSTDisableGrow prevents new data being added to existing PST &#160;files. &#160; The second is a registry change called DisablePST which prevents users creating or opening PST files altogether. &#160;The settings can be applied individually or together to phase out the use of PST files, and they can both be applied through group policy.<\/i><i><\/i><\/span><\/p>\n<p><span class=\"rvts13\"><i>&#160;PSTDisableGrow doesn&#8217;t have a great deal of documentation, but DisablePST is pretty well documented here:&#160;<\/i><i><\/i><\/span><i><a href=\"http:\/\/support.microsoft.com\/kb\/896515\">http:\/\/support.microsoft.com\/kb\/896515<\/a><\/i><span class=\"rvts13\"><i>.&#8221;<\/i><i><\/i><\/span><\/p>\n<p><span class=\"rvts13\">&#160;Silver goes to a hardworking runner-up, striving for automation and convenience&#8230;..<\/span><\/p>\n<p><span class=\"rvts13\">&#160;<b>Smallest database script &#8211; <\/b><b><\/b>Put in the effort, quite useful, but doesn&#8217;t quite have the sheer vital, everyone-must-do-this-now urgency of the first place.<\/span><\/p>\n<p><span class=\"rvts13\"><b>&#160;<\/b><b><\/b><\/span><span class=\"rvts7\"><i>&#8220;It&#8217;s based on one we use as part of our mailbox provisioning process, and it returns the smallest database on a specified server. &#160;By default it sums the sizes of all the mailboxes in each database, but it can also look at the size of the EDB file instead. &#160;(Summing the mailbox size will avoid counting whitespace in the EDB file.) &#160;It would be pretty easy to modify to look at specific storage groups, or use other search criteria (we look for databases which are named according to physical office locations, and pick the smallest database for that office).<\/i><i><\/i><\/span><\/p>\n<p><i>&#160;The script takes two parameters &#8211; the server name and the optional flag to look at EDB file sizes instead of mailbox sizes. &#160;If the server name isn&#8217;t specified you will be prompted for it.<\/i><\/p>\n<p><i>&#160;To get the smallest database on a server name SERVER01 using mailbox sizes:<\/i><\/p>\n<pre>Get-SmallestDatabase.ps1 -server SERVER01\n<\/pre>\n<p><i>To get the smallest database using the EDB file size:<\/i><\/p>\n<pre>Get-SmallestDatabase.ps1 -server SERVER01 -edb\n<\/pre>\n<p><i>The script returns the database object as the output, but again that could easily be changed to suit a particular need.&#8221;<\/i><\/p>\n<pre># Script to return the smallest database on a specified server\n# Written by Ben Lye - 20th August 2008\n&#160;\n# By default the smallest database is determined by summing the size of all the mailboxes in each database.\n# Optionally the -edb flag can be specified to make the script look at the EDB file size instead.\n# If no server name is specified on the command line one will be prompted for\n&#160;\n# Usage:\n# Get-SmallestDatabase.ps1 [-Server &lt;Server name&gt;] [-edb]\n&#160;\n# Get the command line parameters\nParam ([string]$server,[switch]$EDB)\n&#160;\n# Load the Exchange 2007 snap-in if they are not already loaded\nAdd-PSSnapIn -Name Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue\n&#160;\n# Check that the Exchange 2007 snap-in loaded\n$snapin = Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue\nIf (-not $snapin) {\n&#160;&#160;&#160;&#160;&#160;&#160; Write-Host \"Error: Exchange 2007 snap-in not found\" -ForegroundColor \"Red\"\n&#160;&#160;&#160;&#160;&#160;&#160; Write-Host\n&#160;&#160;&#160;&#160;&#160;&#160; break\n}\n&#160;\n# Prompt for a server name if one wasn't passed in\nif (-not $server) {\n&#160;&#160;&#160;&#160;&#160;&#160; $server = Read-Host \"Server name\"\n}\n&#160;\n# Find any databases on the specified server\n$databases = Get-MailboxDatabase -Server \"$server\" -ErrorAction SilentlyContinue\n&#160;\n# Error if there are no databases found\nIf (-not $databases) {\n&#160;&#160;&#160;&#160;&#160;&#160; Write-Host \"Error: No databases found for server $server\" -ForegroundColor \"Red\"\n&#160;&#160;&#160;&#160;&#160;&#160; Write-Host\n&#160;&#160;&#160;&#160;&#160;&#160; $break\n}\n&#160;\nIf ($databases) {\n&#160;&#160;&#160;&#160;&#160;&#160; # Prepare some variables for storing the name and size of the smallest database\n&#160;&#160;&#160;&#160;&#160;&#160; $smallestdbsize = $null\n&#160;&#160;&#160;&#160;&#160;&#160; $smallestdb = $null\n&#160;\n&#160;&#160;&#160;&#160;&#160;&#160; # Loop through each of the databases\n&#160;&#160;&#160;&#160;&#160;&#160; Foreach ($database in $databases) {\n&#160;\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If ($EDB) {\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Get the size of the .edb file\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $dbsize = (get-childitem (\"\\\\\" + $database.Server + \"\\\" + $database.EDBFilePath.PathName -replace(\":\",\"$\")) | select-object name,length).length\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } Else {\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Get the database size in bytes by summing the size of all mailboxes in the database\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $dbsize = (Get-MailboxStatistics -Database $database.Identity&#160; | Measure-Object -Property TotalItemSize -Sum).Sum\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }\n&#160;\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Compare the sizes to find the smallest DB\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (($dbsize -lt $smallestdbsize) -or ($smallestdbsize -eq $null)) {\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $smallestdbsize = $dbsize\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $smallestdb = $database&#160;&#160;&#160; \n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }\n&#160;&#160;&#160;&#160;&#160;&#160; }\n&#160;\n&#160;&#160;&#160;&#160;&#160;&#160; # Return the smallest database\n&#160;&#160;&#160;&#160;&#160;&#160; $smallestdb\n}\n<\/pre>\n<p><span class=\"rvts7\">And finally, the Bronze&#8230;.<\/span><\/p>\n<p><span class=\"rvts7\">&#160;<b>Change the mailbox information cache refresh<\/b><b><\/b>&#160;<b>&#8211;<\/b> Neat, but I guess most of you that are in a hurry to apply mailbox information already caught onto this. Third place.<\/span><\/p>\n<p><span class=\"rvts7\"><i>&#8220;By default the Exchange Information Store service caches information about mailboxes for two hours, meaning that any changes to mailbox quotas can take up to two hours to take effect. &#160;You can change the cache refresh interval to a recommended value of 20 minutes which means that you only have to wait a maximum of 20 minutes for mailbox quota changes to take effect.<\/i><i><\/i><\/span><\/p>\n<p><span class=\"rvts7\"><i>This TechNet article describes the problem and the registry changes required to reduce the cache refresh interval:<\/i><i><\/i><\/span><br \/><i><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/bb684892.aspx\">http:\/\/technet.microsoft.com\/en-us\/library\/bb684892.aspx<\/a>&#8220;<\/i><\/p>\n<hr \/>\n<p>Ben will win the grand prize of a $50 <a href=\"http:\/\/www.amazon.com\/\">Amazon<\/a> voucher for his efforts (that&#8217;s about 1\/6th the <a href=\"http:\/\/wiki.answers.com\/Q\/What_is_the_value_of_an_Olympic_gold_medal\">value of a real Olympic Gold<\/a>, fact fans).<\/p>\n<p>If you want a chance of winning a $50 <a href=\"http:\/\/www.amazon.com\/\">Amazon<\/a> voucher (with last month&#8217;s entry rates, your odds are pretty good), or you simply feel the need to share knowledge with your fellow humans, then send your Exchange top tips for next month&#8217;s competition to <a href=\"mailto:michael.francis@simple-talk.com\">michael.francis@simple-talk.com<\/a>&#160;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Michael Francis hands out imaginary Olympic medals to the winner of the August &#8216;Top Tips for Exchange Admins&#8217;&hellip;<\/p>\n","protected":false},"author":133552,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[32],"tags":[4242,4869,4871],"coauthors":[],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-general","tag-basics","tag-exchange","tag-sysadmin"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/133552"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":5,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":39968,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/424\/revisions\/39968"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=424"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}