Proud to be an Exchange MVP
Video Guides
Surveys
Favorite Exchange Blogs
Microsoft Exchange Blogs
Exchange Training
Site Stats
Members : 2Content : 147
Content View Hits : 140542
| Exchange 2007 / 2010 – Export all Registry Settings using Powershell… |
|
|
| Written by Andy Grogan |
| Sunday, 13 September 2009 22:36 |
|
Been doing a little tidy up and performance review recently on a number of my Exchange Servers in work, and whilst doing so I noticed that I have (over the years) made a number few changes to the Windows Registry in relation to the Exchange Services. However the fact that I had found these changes again and given that the reasons for making them is not the focus of this article, you could be forgiven for asking “why have I raised it?” Well two things occurred to me whilst I was reviewing these settings:
So given the above I started thinking about a way to export all Exchange the Exchange centric registry settings on a server into one file – which can be used for restoration or reference purposes later on. The following is the script which I came up with: $Exch = Get-ChildItem -Path HKLM:\system\CurrentControlSet\Services | where {$_.Name -like '*Exchange*'} $RegSeed = $Exch.Count if (!(Test-Path -path $DirectoryPath)) }else{ While ($SeedIndex -ne $RegSeed){ & $MergeApp /c "Copy $DirectoryPath\*.txt $DirectoryPath\$MergerFile" Write-Host "Script Has Completed" You can download the above script from the following link: In order the use the above script – download it to one of your Exchange Servers (it will work with any Exchange 2007 and 2010 server with either all roles installed or segregated roles (come to think of it, for if you install Powershell on your Exchange 2003 servers it should also work) and execute it from a Powershell Command Window (you do not have to use the Exchange Management Shell in order for it to work as it does not use any Exchange Specific CMDLETS). For example if you download the script to the c:\ drive you could run it via the following method: [ START->RUN ] Then type “Powershell” From the Powershell command window type in the following commands: Set-ExecutionPolicy “RemoteSigned” cd \ c:\ .\ExportExchangeRegistrySettings.ps1 The following is an EXAMPLE screen output from the script: Directory: Microsoft.PowerShell.Core\FileSystem::C:\ Mode LastWriteTime Length Name Upon the script completing, you will find that on your Exchange server there is a new Directory located in c:\ExchRegDirectory; therein you will find a file called “ExchangeServices.txt” – if you open that file in Notepad you should see content similar to the following: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\system\currentcontrolset\services\MSExchange ActiveSync] [HKEY_LOCAL_MACHINE\system\currentcontrolset\services\MSExchange ActiveSync\Diagnostics] [HKEY_LOCAL_MACHINE\system\currentcontrolset\services\MSExchange ActiveSync\HTTP Header Controls] [HKEY_LOCAL_MACHINE\system\currentcontrolset\services\MSExchange ActiveSync\HTTP Header Controls\12.0] [HKEY_LOCAL_MACHINE\system\currentcontrolset\services\MSExchange ActiveSync\HTTP Header Controls\12.1] [HKEY_LOCAL_MACHINE\system\currentcontrolset\services\MSExchange ActiveSync\HTTP Header Controls\2.0] The size and content of this file will depend on the roles installed on the Exchange Server that you have executed the script against, the end result is a file which contains all of the registry settings which are relevant to Exchange on the server you have chosen to query.
|
| Last Updated on Sunday, 13 September 2009 22:38 |



