Finally I had some time to sit down and dig into System.DirectoryServices (S.DS) namespace in .NET 2. Couple of days later and after too many full ashtrays, what I have is 2 things:
- A list of links to resources I found to be very useful while trying to get familiar with the topic:
-
-
-
-
Directory Programming .NET - website run by Ryan Dunn and Joe Kaplan - two Microsoft MVPs and experts in LDAP programming using .NET
-
An application that I wrote using S.DS in VB.NET. I will lie if I would say that I hadn't been inspired by
AdRestore written by Mark Russinovich. The funny thing though, is that in one week I had two people calling me and asking how to either quickly restore a deleted user object or look at the tombstones in the "Deleted Objects" container. Both of the guys I sent to Mark's AdRestore, but I thought to myself: "hey, I want an easy way to look at the 'Deleted Objects' container in the AD and I'd like to have it in GUI with an option to use alternative credentials - options that AdRestore is lacking. Another thing I wanted was being able to point the tool to a specific DC - again AdRestore was not up to it. So I set down, wrote my own tool and called it (surprise! surprise!) ADRestore.NET. To get an Idea of what I am talking about, here is a screenshot of the application in action:
I think the picture is self explaining. You select which objects you want to look fo: either users or computers or both, pick the one that you want to bring back, and click "Restore".
There is one thing you need to remember though - this is not the same as authoritatively restoring an AD object from a backup - when you are using the technique I am using here, what is brought back is the tombstone of the deleted object - a stripped down version having the bare minimum of the attributes. You can forget about group membership, Exchange attributes and things like that. But if you are looking for a quick way to restore an object and all you care about is the object SID, the tool might be quite useful.
Download ADRestore.NET