Resolution
Is is possible to report on the Department and Manager properties of users in the Recycle Bin?
goal
How do I obtain the Department and Manager properties for users in the Recycle Bin?
fact
Directory and Resource Administrator 6.x
fact
Directory and Resource Administrator 7.x
fix
To report on the Department and Manager properties of users in the Recycle Bin, the import code of the Reporting tool must be modified.
There are two ways to get this information: from the Reporting tool or a Script. Below are the instructions using the Reporting tool:
Reporting Tool Instructions
- Navigate to C:\program files\netiq\dra\reporting and open OArept-data.mdb.
- Open the RECYCLE_BIN table.
- Select View | Design View and add a row called Department and Manager (make the field type Memo).
- Save File | Save.
- Close the OArept-Data.mdb database.
- Open the DRA Reporting tool and select File | Clear All data.
- Delete the OArept-draservername.mdb from the reporting directory.
- Open the Reporting tool and connect to the domain.
- Select File | Enter Design Mode.
- Select the Modules Tab.
- Double-click on the Import Module.
- In the declaration drop-down, select the ImportEaRecycleBinNextInBuf() function.
- Add the entries in Red (see Function Excerpt below).
- Select File | Save OArept.
- The information will not be imported into the RECYCLE_BIN table.
- Create a custom report of the desired information.
Function Excerpt
Public Function ImportEaRecycleBinNextInBuf() As Boolean
Dim sErrorMsg As String
Dim sActiveViewName As String
Dim lActiveViewID As Long
Dim bContinueProcessing As Boolean
Dim sClass As String
Dim sEaMessage As String
Dim sMessage As String
Dim strResume As String
Dim bEnumerating As Boolean
Dim errInfo As String
Dim NumberOfRows As Long
Dim i As Long
Dim sAssistantAdminPaths As String
Dim sAssistantAdminName As String
Dim sMcsClass As String
Dim sDomainID As Integer
Dim sDomainName As String
On Error GoTo ImportEaRecycleBinNextInBuf_Err
'STUBBING OUT THE ROUTINE
'ImportEaRecycleBinNextInBuf = True
'GoTo ImportEaRecycleBinNextInBuf_Exit
ImportEaRecycleBinNextInBuf = False
bContinueProcessing = False
gbOpenRecycleBin = False
Set rsRECYCLE_BIN = dbEaImport.OpenRecordset("RECYCLE_BIN")
gbOpenRecycleBin = True
sClass = "Importing Deleted Users"
bEnumerating = True
Set gVarSetIn = Nothing
Set gVarSetIn = CreateObject(gVARSET_OBJECT)
If rsDOMAINS.RecordCount > 0 Then
rsDOMAINS.MoveFirst
Do Until rsDOMAINS.EOF
With rsDOMAINS
If !ManagedByServer And !ImportFrom Then
sDomainID = !DOMAIN_ID
sDomainName = !McsName
Set gVarSetIn = Nothing
Set gVarSetIn = CreateObject(gVARSET_OBJECT)
strResume = ""
bEnumerating = True
While bEnumerating
errInfo = "Load varset"
' required fields
gVarSetIn.put "OperationName", "ContainerEnum"
gVarSetIn.put "Container", gEaPathPrefix & "OU=NetIQRecycleBin," & sDomainName
gVarSetIn.put "ManagedObjectsOnly", True
Dim vHints As Variant
vHints = Array("sAMAccountName", "$McsClass", "$McsOrigParentOfRecycledObj", "whenChanged&q.
uot;, "Department", "Manager")
'Call FillGroupHints(vHints)
gVarSetIn.put "Hints", vHints
' Resume Str
gVarSetIn.put "ResumeStr", strResume
Set gVarSetOut = Nothing
Set gVarSetOut = CreateObject(gVARSET_OBJECT)
DisplayImportProgress "Importing Groups", "Group", "...awaiting data from server", "Domain", sDomainName
DoEvents
Call PerformOperation
Dim restext As String
errInfo = GetPrimaryErrorString(gVarSetOut, restext)
If errInfo <> "" Then
sEaMessage = errInfo
sErrorMsg = "Error importing the Users in the Recycle bin in the Domain " & rsDOMAINS!McsDnsName
If Not LogImportError(0, sEaMessage, sErrorMsg, sClass) Then GoTo ImportEaRecycleBinNextInBuf_Exit
Else
errInfo = "Get data out of the varset"
NumberOfRows = gVarSetOut.Get("NumberOfRows")
If NumberOfRows = 0 Then
bEnumerating = False
strResume = ""
Else
errInfo = "Get IEaEnumerateTableBuf interface out of varset"
Set eaEnumerateBuf = gVarSetOut.Get("IEaEnumerateBuf")
strResume = gVarSetOut.Get("ResumeStr")
For i = 1 To NumberOfRows
errInfo = "Get next row"
If i <> 1 Then eaEnumerateBuf.NextRow
With rsRECYCLE_BIN
.AddNew
!sAMAccountName = GetField()
![$McsClass] = GetField()
![$McsPath] = GetField()
!Date = GetField()
!Domain = sDomainName
!department = GetField()
!Manager = GetField()
.Update
End With
If gnImportState = IMPORT_CANCELLED Then GoTo ImportEaRecycleBinNextInBuf_Exit
DisplayImportProgress "Importing Assistant Admins", "Assistant Admin", sAssistantAdminName, "", ""
Next
End If
End If
bEnumerating = strResume <> ""
Wend ' while bEnumerating
End If
.MoveNext
End With
Loop
End If
ImportEaRecycleBinNextInBuf = True
GoTo ImportEaRecycleBinNextInBuf_Exit
.