Is is possible to report on the Department and Manager properties of users in the Recycle Bin? (NETIQKB44935)

  • 7744935
  • 02-Feb-2007
  • 19-Jun-2007

Resolution

goal
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

  1. Navigate to C:\program files\netiq\dra\reporting and open OArept-data.mdb.
  2. Open the RECYCLE_BIN table.
  3. Select View | Design View and add a row called Department and Manager (make the field type Memo).
  4. Save File | Save.
  5. Close the OArept-Data.mdb database.
  6. Open the DRA Reporting tool and select File | Clear All data.
  7. Delete the OArept-draservername.mdb from the reporting directory.
  8. Open the Reporting tool and connect to the domain.
  9. Select File | Enter Design Mode.
  10. Select the Modules Tab.
  11. Double-click on the Import Module.
  12. In the declaration drop-down, select the ImportEaRecycleBinNextInBuf() function.
  13. Add the entries in Red  (see Function Excerpt below).
  14. Select File | Save OArept.
  15. The information will not be imported into the RECYCLE_BIN table.
  16. 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

.


Additional Information

Formerly known as NETIQKB44935