Sunday, March 31, 2013

Getting an Exchange Database into a Clean Shutdown State using Eseutil


Getting an Exchange Database into a Clean Shutdown State using Eseutil

by MIKE PFEIFFER on APRIL 11, 2010
So you've just restored an Exchange database, and now you are trying to mount it. To your surprise, you are getting an error similar to the following:
Couldn't mount the database that you specified. Specified database: DB2; Errorcode: An Active Manager operation failed. Error: The database action failed. Error: An error occurred while trying to select a database copy for possible activation. Error: The database 'DB2' was not mounted because errors occurred either while validating database copies for possible activation, or while attempting to activate another copy. Detailed error(s):
An Active Manager operation failed. Error: Operation failed with message: MapiExceptionCallFailed: Unable to mount database. (hr=0x80004005, ec=-550)
Before you can mount a database restored from a backup, it needs to be in a clean shutdown state. You can use the Eseutil tool to check whether a database is in a clean shutdown state – if it is not in a clean shutdown state you can perform a repair to get the database into consistency.

Soft Recovery using Eseutil

The first thing you want to do is verify that the database is in a dirty shutdown state. We can do this using the eseutil /mhcommand. For example:
The output from the above command shows us that the database is dirty shutdown:
We can also see from the output, under Log Required, the database is missing a transaction log. We can replay log files into the database (as long as they exist) to get the database into consistency. To do this, we use the following syntax with eseutil:
eseutil /r /l /d
For example, my log file prefix is E02, and my database and logs are stored in G:\E_\Program Files\Microsoft\Exchange Server\V14\Mailbox\DAGDB1 . Here is a screen shot of the command:
When this repair is complete, I can run the eseutil /mh command again to verify that the database is in a clean shut down state:
At this point, I'll be able to mount the database. This will almost always work when you restore a database from a Windows Server Backup, but there may be times when this doesn't work and you need to perform a hard repair.

Performing a Hard Repair

Performing a hard repair using eseutil /p will check the database for any damaged pages; if it finds any, it will delete them. Make sure that you can live without any data inside the database before doing a hard repair, because you may lose data. Also, make sure you have twice as much free space as the size of the database before doing a hard repair – this is required for the temporary database that will be created.
To perform a hard repair, use the eseutil /p command, as shown here:
Once this completes, you can use the eseutil /mh command to verify the database is clean shutdown.

Restore a failed Exchange 2003 Server

Introduction

In order to restore a failed Exchange 2003 Server, you can install a “new” one using the /DisasterRecovery switch, but there are several steps to it, and they need to be performed in the correct order. As I haven’t seen an easily digestive article covering this subject, I thought it was about time to write one.

Note
If you’re the type of Exchange Admin who wants all the details, I suggest you start reading some of the splendid disaster recovery guides available at the Microsoft Exchange Server 2003 Technical Documentation Library. There are also some good guides in the Microsoft Exchange Server 2000 Technical Documentation Library where much of the content also applies to Exchange Server 2003, so that’s definitely worth checking out too.

Making a Copy of the Database and Log files

Depending on the seriousness of the hardware crash and the time available for the restore, I highly recommend you try to make a copy of any accessible database and transaction log files from the server (these are good to have in hand should the databases we restore from backup later on fail), but of course this is only possible if the hard disks containing these files are in a useable state.

Note
Before you can bring the Exchange Server to the state it was in just before the disaster occurred, you would need a copy of the most recent log files.

Installing the New Exchange Server

Server Hardware
When you have received a replacement server or replacements for the failed hardware components, it’s important you configure and partition the disks in the new server, so they are identical to the way they were configured in the old one.

Operating System
We can now install the operating system from the Windows 2003 Server media, also remember to install the Windows Components required by Exchange Server 2003 that is ASP.NET, NNTP, SMTP and the World Wide Web Service. After installing the Windows components we’re ready to apply any Windows 2003 Server Service Pack(s) and post-service pack HotFixes that were installed on the old server.

It’s perfectly fine to give the new server the old server’s NetBIOS name and IP address etc. during the installation, but don’t make the server a member of the domain just yet, instead install it into a workgroup. As the Exchange Server 2003 computer account still exists in Active Directory, we need to reset it before we can make the new Server a member of the domain. This is done by logging on to one of your Domain Controllers (or from any other server or workstation that’s got the Windows 2003 Server Adminpak installed) and opening the Active Directory Users and Computers (ADUC) MMC snap-in, here you drill down and select the Computers container where you right-click the Exchange Server object in the right pane and select Reset Account as shown in Figure 1 below.


Figure 1: Resetting the Computer Account in Active Directory

Click Yes as in Figure 2, then click OK.


Figure 2: Accepting Resetting the Computer Account

When the Computer Account has been reset you can add the “new” Exchange Server to the Active Directory domain by right-clicking My Computer and selecting Properties then clicking Computer Name > Change and specify the Active Directory domain as shown in Figure 3.


Figure 3: Adding the new Exchange Server to the AD domain using the same name

Click OK and specify an account with the permissions necessary to add the computer to the domain, then click OK twice and let the computer reboot. When the computer has rebooted you should logon using an account with the permissions required in order to install Exchange.

Installing Exchange Using the Disaster Recovery Switch

Now that Windows 2003 Server has been configured and prepared, we can move on and start installing Exchange Server 2003 using the /DisasterRecovery switch.

Note
The reason why we install Exchange 2003 Server using the /DisasterRecovery switch is because the configuration information for the Exchange Server still lives in Active Directory. Installing Exchange 2003 Server using the /DisasterRecovery switch will add all necessary Exchange binaries to the server, as well as restore the default Exchange registry settings and re-register the necessary DLL files etc. without touching the configuration information still held in Active Directory.

To get going, insert the Exchange Server 2003 media then click Start > Run and type:

:\Setup\I386\Setup.exe /DisasterRecovery

Where drive is the CD-ROM drive or a mapped drive to a share containing the Exchange 2003 Server binaries. See Figure 4 below.


Figure 4: Running Exchange Server 2003 Setup with the Disaster Recovery Switch

Click Next > Accept the License Agreement then click Next one more time. We will now be presented with the Exchange Components screen shown in Figure 5 below.


Figure 5: Exchange Server 2003 Component Selection

It’s important you specify the same Install Path as the Exchange binaries was installed in on the old server, when you have done so click Next. The Exchange Server 2003 Installation Wizard will now install Exchange in Disaster Recovery mode, see Figure 6 below.


Figure 6: Exchange Server 2003 Installation Wizard Running in Disaster Recovery Mode

Just before the Post-installation kicks off you will get the dialog box shown in Figure 7, it reminds you that the Exchange databases need to be restored from backup after the installation of Exchange Server 2003 in Disaster Recovery mode has completed. Click OK and let the installation finish.


Figure 7: Information Box Reminding You to Restore the databases from Backup

Click Finish.


Figure 8: Completing the Microsoft Exchange Wizard

We now have to install any Exchange 2003 Service Packs that had been applied to the old server, and it’s important that the Service Pack is applied using the /DisasterRecovery switch just like the case with the Exchange Server installation. Similar to the installation of Exchange server this is done by clicking Start > Run and typing:

:\E2K3SP1\Setup\Update.exe /DisasterRecovery

Where drive is the CD-ROM drive or drive mapped to the share containing the Exchange Server 2003 Service Pack 1 binaries.

Note
If installing Exchange Server 2003 Service Pack 1 on a Windows 2003 Server without Service Pack 1 applied, you should apply the HotFix mentioned in MS KB article: 831464 - FIX: IIS 6.0 compression corruption causes access violations prior to installing Exchange Server 2003 Service Pack 1.


Figure 9: Applying Exchange Server 2003 Service Pack 1 using the Disaster Recovery Switch

Click OK then Next. Accept the Agreement and click Next. Verify the Install Path (Figure 10) then click Next.


Figure 10: Exchange Server 2003 Service Pack 1 Component Selection

Note
We will again be reminded that we have to restore the databases from backup after the Installation Wizard finishes off.

Click OK and Finish when the installation has completed, but don’t reboot the server just yet.

Restoring the Exchange Databases

We can now begin restoring the Mailbox and Public Folder Stores from backup, in this article we use NT Backup, you should of course use the backup solution implemented in your Exchange messaging environment.

Before we do anything else let’s open the Exchange System Manager and drill down and expand the Mailbox and Public Folder Stores. Because we installed Exchange Server 2003 using the /DisasterRecovery switch, they should be in a dismounted state, which is also the case in Figure 11 below.


Figure 11: Dismounted Stores in the Exchange System Manager

Note
If you managed to take a copy of the Exchange databases and log files from the old server, now is the time to bring them back to their respective location(s) on the new server and have them mounted. Depending on the state of the stores, you may have to repair them before they can be mounted.

Now start NT Backup by clicking Start > Run and type NTBackup then click the Restore and Manage Media tab. In order to restore the databases from backup right-click File in the left pane and select Catalog, then click Browse and locate the .BKF file or media containing the data that is to be restored. When it has been opened expand the Catalog then select the respective Mailbox and Public folder stores as shown in Figure 12.


Figure 12: Selecting the Mailbox and Public Folder Stores that are to be Restored

Click Start Restore. The box shown in Figure 13 will appear, here the server should already be specified in the Restore To: field, if not do so now. In the Temporary location for log and patch files: specify a temp folder such as the one in Figure 13. Make sure to enable the Last Restore Set (Log file reply will start after this restore completes.) checkbox if there are no additional log files to restore. Select the Mount Database After Restore checkbox depending on whether you want the stores to mount automatically after the restore.

Note
There’s one important thing to have in mind when restoring one or more Mailbox Store(s) from backup after installing a new Exchange Server using the /DisasterRecovery switch, and that is if an Exchange Recovery Storage Group exists when doing the restore, all stores will be redirected to the Recovery Storage Group. This will make the restore job fail and an Event ID Error 9635 will be thrown to the Application log. In order to resolve this problem delete the Recovery Storage Group prior to doing the restore. If you for some reason don’t want to delete the Recovery Storage Group, you can add a DWORD value named Recovery SG Override under HKEY_LOCAL_MACHINE \System\CurrentControlSet\Services\MSExchangeIS\ParametersSystem. Make sure you enable it by specifying 1 in the Value Data box.

Click OK and let the restore job complete.


Figure 13: Specifying the Server and Temp location of the Log files

Click Close.


Figure 14: The Restore is Complete

Now open the Exchange System Manager one more time and verify all Mailbox and Public Folder Stores have been mounted, if not mount them manually. When all the Stores have been mounted make sure you can see the mailboxes in the Mailboxes container under each Mailbox Store. Also verify all Public Folders are listed under in the Public Folder tree. If things show up as expected try to logon to a Mailbox and verify Mail flow, if successful we can call the restore a success – congratulations

About Henrik Walther

Henrik Walther is a Microsoft Exchange MVP, MCA: Messaging (Exchange Ranger) Apprentice, MCITP: Exchange 2007, MCTS: Windows 2008, and MCSE: M+S that works as a Technology Architect for Timengo Consulting A/S, a Microsoft Gold Partner based in Denmark. You can visit his website at: www.exchange-faq.dk (danish).

Click here for Henrik Walther's section.

Using Recovery Storage Group in Exchange 2007

There are some major and significantly good changes in the Exchange 2007 RSG in comparison to the Exchange 2003 RSG and most of them are as a result of the powerful power shell capabilities.

In this article I will describe, step by step, how to configure RSG and how to restore an item or a mailbox from backup.

Requirements and naming conventions

For the purpose of this article, I've used the following objects:

* SQA-LCS2005 - Exchange 2007 standard edition.
* Administrator - Source & destination mailbox on SQA-LCS2005 to restore the selected items from the RSG.
* Backup software - Ntbackup (C:'Backup'ExchDB.bkf – is the backup device that I used).

The process is divided into 4 parts:

1. Having a backup of the DB, a backup that contains the items that were deleted.
2. Create the RSG in the Exchange server.
3. Restore the relevant items / mailbox – Using GUI.

Optional: Restore the relevant items / mailbox – Using MSH.

1. Dismount and remove the RSG.

Having a backup of the DB, a backup that contains the items that were deleted

Note that the backup process usually should run every day automatically; therefore you may skip this step.

Open the Ntbackup software, mark the DB you want to backup and verify that the backup completed successfully:

Create the RSG in the Exchange server

1. Open the EMC (Exchange Management Console), from the Toolbox node, click on the Database Recovery Management:

1. Type the name of your Exchange server and Domain Controller server name and then click Next at the bottom of the screen:

1. From the Tasks options, choose Manage Recovery Storage Group and then click on the Create a Recovery Storage Group:

1. Select the Storage Group that you want to restore from and click Next:

1. Choose the location of the original SG files (DB + Logs).

1. Finish the RSG creation.

1. Verify that the RSG was created using the Exchange Management Shell (MSH):

Restore the relevant items / mailbox – Using GUI

Note that the Administrator mailbox, before the emails deletion, looks as follows:

1. The first step in this section is restoring the DB from the backup.Open the backup software and choose the DB you want, and marked it to restore:

1. Mark the next parameters, as shown in the next screen:

1. Verify that the restore completed successfully.
2. After the restore completed successfully, click the Merge or copy mailbox contents from the Manage Recovery Storage Group:

1. In the mounted Database in the RSG that you restored, click Gather Merge information:

1. The next screen gives you the ability to restore the whole mailbox or all the items in the mailbox from the backup in a simple way by clicking the Perform pre-merge tasks:

1. If you want to filter the items that you want to restore, like items from a specific range of dates, restore the items with a specific subject from all mailboxes to a specific mailbox – you should select the Show advanced Options:

Note: In this example I have chosen to restore all the items with the word TEST (the search is not case sensitive) to the Test_Folder folder in the Administrator's mailbox.

Search by subject (TEST) and copy all the items that will be found to the Administrator's mailbox:

Search the TEST word in the next mailboxes:

1. The result of the process, is shown in the next screen:

Exchange 2003 Shutdown Script

http://www.amset.info/exchange/shutdown-script.asp

Shutdown Script for Exchange 2000/2003
Author: Simon Butler, Exchange MVP, MCSE

This is the Exchange 2003/2000 version of this article. For the Exchange 2007 version - go here.

If you are running Exchange on a domain controller, then you will find that it takes the machine a long time to shutdown. This is because the domain functionality stops quicker than Exchange, therefore Exchange is unable to write to the domain controller and has to be be "killed" by the operating system.

This continual "killing" of the Exchange services, instead of allowing them to shutdown gracefully is not good for the database and is one of the prime reasons for recommending that Exchange is not installed on a domain controller.

A better option is to stop the services before you begin to shutdown the server. This will also cause the server to shutdown more quickly because it isn't waiting for the services to timeout.

Even if you have a dedicated Exchange server, if you are using a UPS, then you may also want to shutdown the Exchange services before the UPS shuts down the OS. In many cases the domain controller may shut down before Exchange, which will cause delays as Exchange needs to communicate with the the domain controller during the shutdown process.

While you can stop the services yourself using the services administrative tool, instead use a batch script with a shortcut on the desktop. Below is a sample script. Simply copy and paste it in to a new notepad document and save it as "stop-exchange.cmd".

Note: These scripts use the Exchange 2003 service names, for other versions of Exchange, simply look in service manager for the full names of the service.

net stop "Microsoft Exchange Information Store" /y net stop "Microsoft Exchange System Attendant" /y net stop "Microsoft Exchange IMAP4" /y net stop "Microsoft Exchange Routing Engine" /y net stop "Microsoft Exchange POP3" /y net stop "Microsoft Exchange Management" /y

If you are using a third party plug-in, then you may find that there is a dependency on that plug-in which can cause the script to fail. The /y at the end of each command should deal with it, but if you find that the third party service doesn't stop in time, adjust the script to include a delay. (Sleep is part of the Windows Resource Kit tools, if you don't have it installed on the server)

For example, this is a script used with an old version of McAfee Group Shield

net stop "McAfee GroupShield Exchange" /y sleep 30 net stop "Microsoft Exchange Information Store" /y net stop "Microsoft Exchange System Attendant" /y net stop "Microsoft Exchange IMAP4" /y net stop "Microsoft Exchange Routing Engine" /y net stop "Microsoft Exchange POP3" /y net stop "Microsoft Exchange Management" /y

Finally, you might also want a script to start Exchange again. This can be useful if you apply an update which requires a restart of the Exchange services, but don't need to restart the server.

net start "Microsoft Exchange Information Store" net start "Microsoft Exchange System Attendant" net start "Microsoft Exchange MTA Stacks" net start "Microsoft Exchange IMAP4" net start "Microsoft Exchange Routing Engine" net start "Microsoft Exchange POP3" net start "Microsoft Exchange Management"

You will notice that there are different services listed in each script. That is because the scripts take advantage of dependencies, therefore allowing you to stop or start one service and due to the dependencies it stops or starts a number of other services automatically. The /y command will answer Yes to any questions about stopping dependant services at the same time.

Shutdown or restart the server afterward stopping Exchange

If you are using these scripts to shutdown Exchange before a server is shutdown (for example by a UPS) or rebooted, then you may want to fully automate the process by scripting the shutdown/restart as well. This can be easily achieved by adding an extra line to the end of the script:

Restart the server

shutdown /r /t 00

Shutdown the server

Wednesday, March 27, 2013

Delete Mail from Multiple Mailboxes (2k7\2k10)


Delete Mail from Multiple Mailboxes


IT Problem

I had this recently where an email had went around a school and was quite sensitive, I needed to find a way ofdeleting the email from every mailbox…and fast. Luckily this can be done in power shell So if you need todelete an email in powershell across the organization quickly follow the guide below.

Note the new section at the bottom of this article for deleting emails in exchange 2010 SP1

IT Solution

This can be done with power shell. See the command below.
NOTICE out of the box these commands are not enabled, you will need to see this article first if you have not already enabled them – Enable Export Mailbox Commands In Exchange 2010
Once the above is done you can now proceed
Get-Mailbox -Database mailboxdb | Export-Mailbox -SubjectKeywords "Virus message" -DeleteContent
Where  MailboxDB is your store and “Virus Message” is the content
You  will need to use an account that has the correct permissions to give the correct permissions to the user use this command
get-mailbox -Database "Mailbox Database"| add-mailboxpermission -user administrator -AccessRights FullAccess
That command will give the correct rights to the administrator account.



Delete Email From Exchange 2010 SP1

Microsoft changed a few commands for SP1  of exchange 2010.
In Exchange 2010 SP1, we use the  New-MailboxExportRequest and the New-MailboxImportRequest to exportimport emails. You also use this in conjunction with the  Search-Mailbox command and add the add parameter -DeleteContent.
For example,
Get-Mailbox -Server  "your server" | Search-Mailbox -SearchQuery 'Subject:"pictures of your mum"' -DeleteContent

Tuesday, March 26, 2013

Paging File Sizing in Exchange Server 2007



Refer this http://blogs.technet.com/mikelag/archive/2007/12/19/working-set-trimming.aspx
&&&&& the below:


Virtual memory is a mature, well-understood technology that was first developed in the early 1960s. It's a basic part of every computer science course on operating systems, and it's been a familiar part of Windows since Windows NT first shipped. The idea behind virtual memory systems is that applications (and the OS) can use disk space as a substitute for RAM. The virtual memory manager (VMM) swaps chunks, or pages, of memory in and out as applications request the contents of specific memory blocks. This procedure lets servers handle larger workloads without necessarily requiring a huge amount of physical RAM.
Of course, there's no such thing as a free lunch. If the amount of physical RAM in a computer is insufficient for its workload, the VMM must frequently swap pages to and from disk. As a result, performance can suffer because paging is a disk-bound operation.
Most administrators ignore the virtual memory subsystem in Windows, leaving it alone to do its job—an excellent idea, given that the VMM in Windows is largely self-tuning. It turns out, however, that in some cases you might need to adjust the size of the paging file, the disk-based store used to hold memory contents that are swapped out. Knowing when to adjust the paging file, and what size to use for it, will help you squeeze the best possible performance out of your Exchange servers.
You'll find the basic rule for paging file sizing for Exchange servers on Microsoft's"Exchange 2007 System Requirements" Web page. It's fairly simple: Set the paging file size to equal the amount of physical RAM in the server, plus 10MB. At first glance, this rule seems reasonable—until you consider that Exchange Server 2007, which requires a 64-bit Windows OS, can address large amounts of RAM by virtue of x64 Windows' support for much larger address spaces. Do you really need a 32GB paging file for a server with 32GB of physical RAM? After all, you might think that with so much RAM, the system will never need to page.
In a word, the answer is yes. Exchange 2007 dynamically adjusts the amount of RAM it uses for caching ESE database pages. This dynamic adjustment process was introduced in Exchange Server 5.5 and was known as Dynamic Buffer Allocation. Its implementation is nuanced, but it can be described simply: Exchange grabs as much RAM as it can, then gives back RAM when other applications require it.
One key measure that Exchange uses to decide when to reduce its cache size is the amount of paging going on. Say that you have a server with 16GB of RAM and a 1GB paging file. This configuration is way out of balance and will severely thrash the paging file—that is, generate a large volume of disk I/O by reading and writing pages from disk—when the system is under heavy load. Exchange detects the thrashing and backs off the amount of RAM it uses to cache ESE pages, which then increases the amount of disk I/O required for ESE access, a situation that further hurts server performance.
Paging isn't the only factor that affects how Exchange allocates RAM for its ESE cache, but it's the one that you have the most influence over. Microsoft recommends the nearly 1:1 paging file–to-RAM ratio to keep the amount of paging overhead low, which avoids misleading the Exchange cache allocation algorithm into taking too much or too little RAM. Why the recommendation to add 10MB beyond the server's physical RAM to the paging file? It turns out that Windows uses the paging file to cache some types of internal data (Microsoft hasn't said exactly what), and leaving that 10MB buffer lets Exchange and other memory-intensive applications use paging file space up to the amount of the physical RAM.



Wednesday, March 20, 2013

No roll back option for Exchange Service Packs


No, It's not possible to uninstall an Exchange Service Pack

What you should do is to patch your other servers.

Note:
  1. A CAS Server should always be the upgraded before HUB and MB
  2. SP2 hasn't been supported for over a year now.


There are schema changes for Exchange SP3, you also cannot roll it back, once you have installed it.

The Exchange Service Packs are complete installs and the only way to remove it would be to remove Exchange from the server completely.

Exchange 2k7 sp3 --> Allowing end-users to change their expired passwords using OWA (Outlook Web Access)


Password Change in OWA with Exchange 2007 SP3:

Now that we went through the process of installing Exchange Management Tools on Windows 7 and also on Windows Server 2008 R2, we can check one of the new features introduced in this new release which is the Exchange Server 2007 SP3 Password Reset Tool.
This tool is only for Exchange Server 2007 using IIS 7.x because SP3 creates a new module for that purpose on IIS 7 only. Bear in mind that this feature is only for the Client Access Server roles, if you have a NLB make sure to enable all of them with the steps that we will list in this article.
Before explaining the feature let's understand the context where this new feature can help the end-users. Basically when we create a new user or when a user password is reset and the option User must change password at next logon is selected (Figure 7), if the user tries to log on using OWA the user will receive the following error message:The user name or password that you entered is not valid. Try entering it again.
http://www.andersonpatricio.org/Tutoriais/Exchange2007/ap991_02.png
Figure 7
If you have ISA Server in order to publish your OWA you may not need to change anything since ISA has this feature built-in to fix the issue described previously. However, if you don’t have ISA, you have to publish Exchange Server using a different firewall make sure that the internal OWA is able to change expired passwords, then this new feature will help you.
Note:
If you are an ISA customer and want to validate if you are using a similar feature, this page can help you out. 
Okay, let’s go to the fun stuff. In order to enable OWA to change expired passwords, we can use the following steps:
  1. Logged on the Client Access Server
  2. Click on StartRun and type in regedit and click on OK
  3. Expand HKEY_LOCAL_Machine
  4. Expand System
  5. Expand CurrentControlSet
  6. Expand Services
  7. Click on MSExchange OWA
  8. Right-click on the right side, and click on New  and then DWORD (32 bit) value
  9. Let’s name the key as ChangeExpiredPasswordEnabled and its value will be 1, as shown in Figure 08
http://www.andersonpatricio.org/Tutoriais/Exchange2007/ap991_03.png
Figure 8
After changing the registry information we need to restart IIS, we can use IISReset /noforce and then we will be ready to start testing. The test is not a big deal, just create a new user and try to log on in OWA, the user will receive a new OWA form asking for the current password and the new password, as shown in figure 09.
http://www.andersonpatricio.org/Tutoriais/Exchange2007/ap991_04.png
Figure 9
After typing new passwords and hitting the Submit button, a new page will appear with the information that the password has been changed will be displayed. The user just needs to click OK (Figure 10) and then type in again the user name and the new password to access its OWA.
http://www.andersonpatricio.org/Tutoriais/Exchange2007/ap991_05.png
Figure 10
As you may have noticed, this article is showing some ways to automate the process. If you want to enable the feature described previously you can save the following lines in a file and save it as .ps1 and run it from a PowerShell session.
Write-Host "Adding ChangeExpiredPasswordEnable key in the registry..." 
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\services\MSExchange OWA" -Name "ChangeExpiredPasswordEnabled" -Value 1 -PropertyType "DWord" 
Write-Host "Restarting IIS using /noforce option.." 
IISReset /noforce
Note:You may have to use Set-ExecutionPolicy unrestricted in order to run the script.

Conclusion

In this article we validated the installation process of Exchange Server 2007 SP3 on top of the new Operating System supported by the product and also how to enable the Reset Password feature.

Monday, March 18, 2013

Purging any windows logs with Task Sheduler in Win 2003 & Win 2008

http://social.technet.microsoft.com/Forums/en-US/configmgrgeneral/thread/d989b249-0159-41fc-b78c-1f1d91ce8bb3/


The mistake I found in Tom Watson's script is the added backslash \ before the Cmd.exe string resulting in the following:
ERROR: Invalid syntax. '/C' option is not allowed more than '1' time(s).
Type "FORFILES /?" for usage.
The fix, at least in my case was to remove the backslash \ as shown below.
Windows 2003
at 12:00 /EVERY:Su Forfiles.exe -p C:\WINDOWS\system32\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path\"

Windows 2008
at 12:00 /EVERY:Su Forfiles.exe -p C:\inetpub\logs\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path\"