Hi,
I downloaded one of the spreadsheets from this site that documents information about a CMS (Universes, reports, etc.)
I have added another tab to the spreadsheet with User information - I’m able to access all the “top-level” properties using this code and write this to the spreadsheet sing this code:
Private Sub getUsers()
'Purge existing data
Sheets("User Information").Range("A2:IV65536").ClearContents
'Session Manager declaration
Dim SessionManager, Sess As SessionMgr
'Enterprise Session declaration
Dim esession As EnterpriseSession
'InfoStore declaration
Dim iStore As InfoStore
'Info Objects declaration
Dim UserList As InfoObjects
'Info Object declaration
Dim UserItem As InfoObject
'User Object declaration
Dim Rng As Excel.Range
Dim RowNum As Long
Dim strSQL As String
Dim i As Integer
On Error GoTo ErrorHandler
'Session Manager instanciation
Set SessionManager = CreateObject("CrystalEnterprise.SessionMgr")
'Enterprise Session instanciation
Set esession = SessionManager.Logon(tbName, tbPassword, tbCMS, strAuth)
strSQL = "Select top 10000 SI_ID, SI_NAME, SI_USERFULLNAME,SI_EMAIL_ADDRESS, SI_CREATION_TIME, SI_LASTLOGONTIME, SI_UPDATE_TS, SI_ALIASES FROM CI_SYSTEMOBJECTS WHERE SI_KIND = 'User' and SI_UserFullName != '' "
'Infostore instanciation
Set iStore = esession.Service("", "InfoStore")
Set UserList = iStore.Query(strSQL)
Set Rng = Sheets("User Information").Cells
RowNum = 1
Rng(RowNum, 1) = "User ID"
Rng(RowNum, 2) = "Name"
Rng(RowNum, 3) = "User Full Name"
Rng(RowNum, 4) = "Email"
Rng(RowNum, 5) = "Date Created"
Rng(RowNum, 6) = "Last Login"
RowNum = RowNum + 1
For Each UserItem In UserList
Rng(RowNum, 1) = UserItem.ID
For i = 1 To UserItem.Properties.Count
If UserItem.Properties.Item(i).Name = "SI_NAME" Then
Rng(RowNum, 2) = UserItem.Properties.Item(i).Value
End If
If UserItem.Properties.Item(i).Name = "SI_USERFULLNAME" Then
Rng(RowNum, 3) = UserItem.Properties.Item(i).Value
End If
If UserItem.Properties.Item(i).Name = "SI_EMAIL_ADDRESS" Then
Rng(RowNum, 4) = UserItem.Properties.Item(i).Value
End If
If UserItem.Properties.Item(i).Name = "SI_CREATION_TIME" Then
Rng(RowNum, 5) = UserItem.Properties.Item(i).Value
End If
If UserItem.Properties.Item(i).Name = "SI_LASTLOGONTIME" Then
Rng(RowNum, 6) = UserItem.Properties.Item(i).Value
End If
Next i
RowNum = RowNum + 1
Next UserItem
End Sub
I want to access the SI_ALIASES properties (i.e. SI_NAME, SI_DISABLED, SI_ID and SI_TOTAL). My understanding is that I have to use “Property Bags” to get at these properties.
Can anyone point me in the right direction to access these properties using VBA?
sunsethill (BOB member since 2007-01-29)