Date and Time Math with PowerShell

How many times have you had to figure out what date was X days, months, or years ago, or perhaps what time was Y minutes, hours, or seconds ago? Producing a report of all the users who have not logged in during the past 90 days is a pretty common request. There’s two ways to go about doing this – the lazy way and the precise way. The lazy way is to say well 90 days is about three months ago, and it’s 11/24 today so that would be 8/24. The precise way is to realize that 90 days go … Continue reading Date and Time Math with PowerShell

Error When Removing Exchange 2000 or 2003 Server

There are a litany of issues that will cause Exchange setup to fail when you try to uninstall an Exchange server. It’s really tempting to just skip the uninstall and go delete the server entry from AD using something like ADSI Edit, but, you’re always better off just fixing the problem. Michael B. Smith has a good review of these, however I thought I’d touch on one more, specifically the error "One or more users currently use a mailbox store on this server". This can be really frustrating, especially when you’ve checked each mailbox store for mailboxes and done a … Continue reading Error When Removing Exchange 2000 or 2003 Server

Cleanup User Objects with Invalid MailNicknames

Exchange 2000 and Exchange 2003 have no problem with users (or groups and contacts) which have a space in their mailNickname attribute. Unfortunately if you try to work with one of these users using Exchange 2007 or Exchange 2010, the PowerShell cmdlets will throw a validation error similar to the following: Property expression "John Doe" isn’t valid. Valid values are: Strings formed with characters from A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $, %, &, ‘, *, +, -, /, =, ?, ^, _, `, {, |, } or ~. One or more periods … Continue reading Cleanup User Objects with Invalid MailNicknames

Viewing the History of an Active Directory Object with Replication Metadata

I answered a question via Twitter the other day as to whether or not it was possible to see when someone was added to a group without relying on audit information. The good news is that the answer is “Yes!” – assuming your forest is running in the Windows Server 2003 Forest Functional Level (FFL2) or better, and that the user was added after you upgraded your forest to this level. You can also see when a user was removed, however once they’ve been removed you won’t be able to see when they were added. Start with FFL2, linked values, … Continue reading Viewing the History of an Active Directory Object with Replication Metadata