A user object that gets deleted in AD does not actually just disappear. The object is tomestoned and with a few tools can be identified and restored. Microsoft has a tool called LDP.exe that is in the Windows Support Tools for Windows 2003 that can help you identify a deleted Object in Active Directory. Here is the link http://support.microsoft.com/kb/258310.
I supposed the idea behind this is after you id the object you can do an authoritative restore and get the object back. I found that LDP was a little encumbersum when it can to identifying the deleted Object.
There is another free tool that seemed to work very well which is called Adrestore.exe. By Mark Russinovich I was able to get all the info that I needed to restore by using a command line switch and filtering for the user name. Here is the link http://technet.microsoft.com/en-us/sysinternals/bb963906.aspx
Wednesday, February 23, 2011
Tuesday, February 8, 2011
Enumerating Members of a Group
This is a VB script that queries members in a specified group in AD and list them in an Execl work sheet.
Dim objGroup, objExcel, iRow, strUser
Set objGroup = GetObject(ldap://cn=ACCOUNTING,ou=MARKETING,DC=SUNSET,DC=SIGNS,DC=LCL/)
Set objExcel = CreateObject("Excel.Application")
With objExcel
.SheetsInNewWorkbook = 1
.Workbooks.Add
.Visible = True
.Worksheets.Item(1).Name = mid(objGroup.Name, instr(1,objGroup.Name,"=") + 1 ) 'set Worksheet name to that of the DL
rem .Worksheets.Item(1).Name = dldump
.Cells(1,1) = "UserID"
irow=2
For Each strUser in objGroup.Member
Set objUser = GetObject("LDAP://" & strUser)
.Cells(iRow,1) = objUser.samaccountname
irow=irow + 1
Next
.Columns(1).entirecolumn.autofit
End With
Set objExcel = Nothing
Set objGroup = Nothing
Dim objGroup, objExcel, iRow, strUser
Set objGroup = GetObject(ldap://cn=ACCOUNTING,ou=MARKETING,DC=SUNSET,DC=SIGNS,DC=LCL/)
Set objExcel = CreateObject("Excel.Application")
With objExcel
.SheetsInNewWorkbook = 1
.Workbooks.Add
.Visible = True
.Worksheets.Item(1).Name = mid(objGroup.Name, instr(1,objGroup.Name,"=") + 1 ) 'set Worksheet name to that of the DL
rem .Worksheets.Item(1).Name = dldump
.Cells(1,1) = "UserID"
irow=2
For Each strUser in objGroup.Member
Set objUser = GetObject("LDAP://" & strUser)
.Cells(iRow,1) = objUser.samaccountname
irow=irow + 1
Next
.Columns(1).entirecolumn.autofit
End With
Set objExcel = Nothing
Set objGroup = Nothing
Subscribe to:
Posts (Atom)