' This script was originally published in the Exchange Cookbook, ' (http://www.exchangebookcook.com). Written by Paul Robichaux, ' Missy Koslosky, and Devin Ganger. Redistributed with permission ' of the publisher, O'Reilly & Associates. ' ------ SCRIPT CONFIGURATION ------ strComputerName = "" ' e.g. "batman" ' ------ END CONFIGURATION --------- strE2K3WMIQuery = "winmgmts://" & strComputerName &_ "/root/MicrosoftExchangeV2" ' Find each mailbox on the target server. Get the last logon date and user. ' Display them all. Set mboxList = GetObject(strE2K3WMIQuery).InstancesOf("Exchange_Mailbox") For each mailbox in mboxList strOutput = "" strOutput = "Mailbox: " & mailbox.MailboxDisplayName & vbCRLF theTime = mailbox.LastLogonTime If (IsNull(theTime)) then strOutput = strOutput & " Never logged on" & vbCRLF else strOutput = strOutput & " Last logon at: " & theTime & vbCRLF strOutput = strOutput & " by: " & mailbox.LastLoggedOnUserAccount End If WScript.Echo strOutput Next