Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Users in groups query 1

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
What would the syntax be for obtaining a list of Enterprise groups, and all users within that group?

I have been through the SDK, but everything I try delivers incorrect results.

All I need is a simple outout that shows:

Enterprise group Username
Finance John Smith
Finance Mary Wheeler
Finance Chris Todd
Operations Mary Wheeler
Operations Peter Johnson

Etc




EO
Hertfordshire, England
 
Hi,
Try this..Be sure to use your CMS info..
Also, watch for too many groups/Users, it could take a long time - I limited this test one to 5 Groups.
( For instance the All Users Group can get very big)

Code:
 <%@ Language=VBScript %>
<HTML>
<HEAD>
<title>BOE XI Reports MetaData Page</title>
<link rel="stylesheet" type="text/css" href="rsc/style/template_style.css"/>
<style type="text/css">
body {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;
	color:#5F5F5F;
	text-decoration:none;
	scrollbar-arrow-color:#003366;
	scrollbar-base-color:#C0C0C0;
	scrollbar-darkshadow-color:#6699cc;
	scrollbar-face-color:#6699cc;
	scrollbar-highlight-color:;
	scrollbar-shadow-color:;
}

table {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;
	color:#5F5F5F;
	text-decoration:none;
}

td {
	vertical-align:top;
    }
 
</style>
</HEAD>

<BODY>
<%

Const APS = "<YourCmsServer>"

Const UserID = "<SomeAccount>"

Const Password= "<Password"

Const Aut = "secEnterprise"

Function Logon(ByRef IStore)

    Dim SessionManager 
    Dim Result
    Result = FALSE
    Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr")
    If Err.Number = 0 then
        Dim Sess
        Set Sess = SessionManager.Logon(UserID, Password, APS, Aut)
        If Err.Number = 0 then 
          Set IStore = Sess.Service ("", "InfoStore")
          Set Session("IStore") = IStore
          Result = TRUE
        End If
    end if
   Logon = Result
End Function

Function MakeWebPage(Reports)
   Dim indx1
   Dim indx2
   Dim Result2
   Dim MyStore  
   Set MyStore = Session("IStore") 
   Response.Write("<HTML>")
   Response.Write("<BODY")
   Response.Write("<FORM Name='main'>")
   Response.Write("<TABLE>")
   For indx1 = 1 to Reports.Count
  Response.Write("<TR><TD style=color=red>GroupID is  " & Reports(indx1).ID & " And it is named " & Reports(indx1).Title & "</TD></TR>" )
    Set Usr = Reports(indx1).PluginInterface.Users 
      Response.Write("<TR><TD style=color=green> Users in this Group: </TD></TR>")
        For indx2 = 1 to Usr.Count
         Result2 = MyStore.Query("Select SI_NAME FROM CI_SYSTEMOBJECTS WHERE SI_ID = '" & Usr(indx2) & "'")
      Response.Write("<TR><TD style=color=blue> " & Result2(1)  & "</TD></TR>")
       next
  Next
Response.Write("</TABLE>")
  End Function



Sub Main
   Logon IStore
   Set Result = IStore.Query("Select TOP 5 *  From CI_SYSTEMOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.UserGroup' AND SI_NAME LIKE '%AD%'")
   MakeWebPage(Result)
    End Sub

Main


%>
</BODY>
</HTML>









[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top