Querybuilder is my real achilles heel when it comes to XI R2 admin stuff so bear with me on this. I’ve done some google searching and such, but haven’t found this one. I want a list of users who are in the “Everyone” group, but who are not in any other groups. I know that we have some users like this and I need to identify them. Does anyone have a query that will give me this info? If not, can anyone confirm that it’s possible to formulate a query that would give me this result? I don’t want to spend a ton of time trying to create a query that isn’t possible.
I may not have been clear about what I was looking for. I realize all users are members of the Everyone group. What I’m trying to find are users who are members of the Everyone group and who are not members of any other group.
Hi,
If that is the case, i would be inclined to go for Utility in BOB downloads which lists all users by Groups through Which you easily identify the users who are not part of any group.
Or a simple trick. Run the macro to get user groups. Do not iterate through the group. there is a for loop to iterate through all the groups. Without for loop this query bring all users with the first available group. So for all user where you see group as everyone group will be the users who are not a part of any other group. Works fine i have tested it.
I used the below code( remove for loop) Call group name for first group ID to generate a txt file and then open it in xls.
or you can generate your own code just call group ID one in the SI_USERGROUPS.
'Build the query
Query1 = "SELECT top 10 SI_ID,SI_NAME,SI_USERGROUPS,SI_LASTLOGONTIME,SI_EMAIL_ADDRESS FROM CI_SYSTEMOBJECTS WHERE SI_KIND = 'User' order by SI_ID"
' Execute the query
Set retvals = iStore.Query(Query1)
Call LogMessage(VbaLog, " Saving the query results into extract file ")
ExtFileNum = FreeFile()
Open DataExtract For Append As #ExtFileNum
J = 0
For Each retItem In retvals
J = J + 1
UserId = retvals.Item(J).Properties(1).Value
UserName = retvals.Item(J).Properties(2).Value
groupname = getGroupName(retItem.Properties(3).Properties.Item(1))
Logon = retvals.Item(J).Properties(4).Value
Email = retvals.Item(J).Properties(5).Value
TableRec = UserId & "||" & UserName & "||" & groupname & "||" & Logon & "||" & Email
Print #ExtFileNum, TableRec
Next retItem
Close #ExtFileNum
esession.Logoff
Public Function getGroupName(GrpId) As String
On Error Resume Next 'GoTo ErrHandler
dbug = "Finding Universe"
Dim Query4
Query4 = "select si_name from CI_SYSTEMOBJECTS where si_id = " & GrpId
Dim Result4 As InfoObjects
Set Result4 = iStore.Query(Query4)
Dim GrpName
Dim oReport3
For Each oReport3 In Result4
GrpName = oReport3.Properties.Item("SI_NAME")
Next
getGroupName = GrpName
Exit Function