Troubleshooting
Problem
Can you export a user class list from Access Manager to a text file.
Resolving The Problem
Yes, this can be accomplished using Access Manager OLE
automation.
The following macro will write the user class list
in the runtime namespace to a text file with the associated users per user
class. The macro can be run from the Cognos Script Editor. Note: You will have
to modify environment specific entries such as User ID, password, and text file
location as necessary.
*===============================================================================
=====================================
' * ClassUserList.mac
'
*
' * This macro gets the userclass list and, for each userclass, the
users list.
' * All are written into a text file.
' *
'
*===============================================================================
=====================================
Option Explicit
Sub Get_Users_List(UserClass As Object)
Dim I As
Integer
If UserClass.Users.Count > 0 Then
For I = 1 To
UserClass.Users.Count
Print #1, UserClass.Name & ":" &
UserClass.Users(I).Name
Next
else
Print #1, UserClass.Name
& ":"
End If
If UserClass.UserClasses.Count
>= 0 Then
For I = 1 To UserClass.UserClasses.Count
Call
Get_Users_List(UserClass.UserClasses(I))
Next
End If
End Sub
Sub Main()
Dim objAuthApp As
Object ' Access Manager Application Object
Dim objAuthDoc As Object '
Access Manager Document Object
Dim objDSConfig As Object
Const AdminUser = "Administrator"
Const AdminSignon =
""
Const NameSpace = "default"
Const FileName
= "C:\ClassUsers.Txt"
' Calls Access Manager and opens
namespace with admin signon
Set objAuthApp =
CreateObject("Authenticator2.Application")
Set objAuthDoc =
objAuthApp.Documents.OpenWithBasicSignon(NameSpace, AdminUser, AdminSignon,
0)
' Opens output file and writes title
Open FileName For
Output As #1
Print #1, "User Class:User Name"
'
Calls recursive procedure for getting users list
Call
Get_Users_List(objAuthDoc.RootUserClass)
' Closes output
file
Close #1
' Exits Access Manager
objAuthApp.Quit
Set objAuthDoc = Nothing
Set objAuthApp =
Nothing
End Sub
Historical Number
106925
Was this topic helpful?
Document Information
Modified date:
28 November 2022
UID
swg21336892