IBM Support

Is it possible to export a user class list from access manager to a text file.

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

[{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Access Manager","Platform":[{"code":"PF025","label":"Platform Independent"},{"code":"PF033","label":"Windows"}],"Version":"Access Manager 6.1;Access Manager 7.0;Access Manager 7.1;Access Manager 7.3;Access Manager 7.4;Cognos 8 BI Access Manager 7.3;Cognos 8 BI Security 8.2;Impromptu 7.0;Impromptu 7.3;Impromptu Web Reports 7.3;PowerPlay Client 7.3;PowerPlay Enterprise Server 7.4","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Security","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Security","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Impromptu","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Impromptu Web Reports","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"PowerPlay","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"PowerPlay Enterprise Server","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

106925

Document Information

Modified date:
28 November 2022

UID

swg21336892