Disconnected mailboxes and disconnected date

To display mailboxes that are disconnected use the following command.
Replace with the name of your mailbox server.
This gives a list of the disconnected mailboxes.
Get-MailboxStatistics -Server | where { $_.DisconnectDate -ne $null } | select DisplayName,DisconnectDate

To reconnect you use the command below
Connect-mailbox –database "mailbox database name" –Identity "disconnected mailbox name" –User "User to connect to"

Find the last time a database was accessed

select d.name, x1 =
(select X1= max(bb.xx)
from (
select xx = max(last_user_seek)
where max(last_user_seek) is not null
union all
select xx = max(last_user_scan)
where max(last_user_scan) is not null
union all
select xx = max(last_user_lookup)
where max(last_user_lookup) is not null
union all
select xx = max(last_user_update)
where max(last_user_update) is not null) bb)
FROM master.dbo.sysdatabases d
left outer join
sys.dm_db_index_usage_stats s
on d.dbid= s.database_id
group by d.name

Enable or Disable Circular Logging in Exchange 2010

Open Exchange Management Console
  1. In Organization Configuration click on Mailbox
  2. Tab Database Management
  3. Right click on the database
  4. Tab Maintenance
  5. Check “Enable circular logging”

Set-MailboxDatabase -CircularloggingEnabled:$true

Remember to re-disable it when done.

Set-MailboxDatabase -CircularloggingEnabled:$false

Exchange 2010: Which mailbox is linked to a specific email address?

If you want to find a email address that is used in the organisation but you don’t know the mailbox it is linked to.
This works for aliases to.

[PS] C:\Windows\system32>Get-Recipient random.email@company.com

Name                                                                    RecipientType
—-                                                                          ————-
Test User                                                              UserMailbox


Export all your Exchange email addresses to CSV

To create a list of all your email addresses including the primary and alias addresses run this PowerShell command;

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\smtp.csv -NoTypeInformation

Rebuild Exchange 2010 Search Index

A few times a year a user complains that searching trough his mailbox is not accurate.
Rebuilding the Exchange Search Index will usually solve this.

There is a default PowerShell script to reset the Search Index.
Open the Exchange Management Shell and navigate to %PROGRAMFILES%\Microsoft\Exchange Server\V14\Scripts and then run the following command:

.\ResetSearchIndex.ps1 -force -all

This will stop the MSExchangeSearch service and delete the catalog data for all mailstores.

More info over How to Rebuild the Full-Text Index Catalog in this technet article.

Export Windows Update list

If you want to export a list of updates installed on a Windows 2008 server, there is a built in tool to do this.
Use the WMIs Command-line interface (WMIC) to export this list.

On the command line:

wmic qfe get /format:csv > C:\updates.csv

You can use these other format options:


LIST is Tab Delimited