Powershell to Settup ManagedFolderAssistantSchedule in all Exchange 2007 Mailbox Servers

The managed folder assistant is a Microsoft Exchange Mailbox Assistant that creates managed folders in users’ mailboxes and applies managed content settings to them. When the managed folder assistant is running, it processes all of the mailboxes on a server. If the managed folder assistant does not finish processing the mailboxes on the server during the time that you have scheduled, it automatically resumes processing where it left off the next time it runs. There is one managed folder assistant for each server

Get-ExchangeServer | Where { $_.AdminDisplayVersion.ToString().SubString(0, 10) -eq “Version 8.” `

-and $_.ServerRole -eq “Mailbox” } |

ForEach { Set-MailboxServer -Identity $_.Identity `

-ManagedFolderAssistantSchedule “Sun.1:00 AM-Sun.3:00 AM”, `

“Mon.1:00 AM-Mon.3:00 AM”, “Tue.1:00 AM-Tue.3:00 AM”, `

“Wed.1:00 AM-Wed.3:00 AM”, “Thu.1:00 AM-Thu.3:00 AM”, `

“Fri.1:00 AM-Fri.3:00 AM”, “Sat.1:00 AM-Sat.3:00 AM” }

http://technet.microsoft.com/en-us/library/bb123958.aspx

Powershell to Customize Exchange 2007 Online Maintenance

Powershell to customize online maintenance schedule. During this interval, tasks like dumpster cleanup (the deletion of messages that have passed their deleted item retention date), deleted mailbox cleanup, and online defragmentation (database objects that are no longer being used are detected and removed, thereby making additional database space available) are performed. These processes keep the Exchange Server computer healthy and the performance stable. Online maintenance should be set to run at least four hours a day; failing to do so will cause performance degradation over time.

Get-MailboxDatabase | Set-MailboxDatabase -MaintenanceSchedule “Sun.1:00 PM-Sun.5:00 PM”,”Mon.1:00 PM-Mon.5:00 PM”, “Tue.1:00 PM-Tue.5:00 PM”, “Wed.1:00 PM-Wed.5:00 PM”,”Thu.1:00 PM-Thu.5:00 PM”, “Fri.1:00 PM-Fri.5:00 PM”,”Sat.1:00 PM-Sat.5:00 PM”