Skip to Content

Hello,

I had created this script for a previous requirement. Please leverage it as per your need.

Instruction:

1: In order to run this script on a windows platform, BusinessObjects Client Tools installed on that box.

2: You will need to change CMS name, port and Administrator password.

3:You will need to change the name of the Event for which you want the list of Instance. In the script it mentioned as entereventname

4:If you want the list of Instances triggereing a perticular event then change SI_DEPENDENCIES with SI_DEPENDANTS in the script and enter the event name

3: In case you do not have write access on C: Drive, change the path of the output file to the location where your User credential has access on that box.

4: Copy this highlighted content in a text file and rename it to InstancesOnaEvent.vbs and run it (right click >> Open) from the box as per prerequisites mentioned in

#Point 1

And Last but not the least, if you are planning to run it in a production environment and if you have a lot of Users and Groups in your environment, you might want to run it in a non-load time to avoid any unnecessary load on the CMS.

—————————————————————————————————————————————————-

Option Explicit

‘ **********************************************************

‘ ***********Script written By Animesh Kumar ****************

‘ *************** animesh.kumar5@cognizant.com **************

‘ **********************************************************

‘ This script queries the CMS for instances based on a *****

‘ **********************particular event*******************

‘ ***********************WARNING****************************

‘ This script is not part of any product from Business Objects

‘ and is merely a result of hit and trials while working on an

‘ issue for a specific customer.

‘ since this script has been written for testing purpose only,

‘ it is not entitled to receive support.

‘ ************ USE THIS SCRIPT AT YOUR OWN RISK ************

‘ **********************************************************

Dim objSessionManager

Dim objEnterpriseSession

Dim objSession

Dim objMyReportEventInfo

Dim iStore

Dim objMyUserInfo

Dim strMyname

Dim ReportProperties

Dim strKindInInfoObj

Dim strObjName

Dim eventid

Dim ReportName

Dim ReportId

Dim ReportKind

Dim ReportOwner

Dim EventProperties

Dim ReportProgress

‘For the logon, Authenticate as Following

Const APS = “CMSNAME:CMSPORT”

Const UserID=”Administrator”

Const Password = “”

Const Auth = “SecEnterprise”

‘ Variables used for working with MS Excel file

Dim objExcel, strPathExcel, objSheet, strOldUserName, strNewUserName

Dim objFile, strGuyFile, intRow

‘Create an Enterprise objSessionManager

Set objSessionManager = CreateObject(“CrystalEnterprise.SessionMgr”)

Set objSession = objSessionManager.Logon(UserID, Password, APS, Auth)

‘Create a new Variable for the login token

Set iStore = objSession.Service(“”, “InfoStore”)

‘ Open a log file

Dim objLog, objLogFile

Set objLog = CreateObject(“scripting.filesystemobject”)

Set objLogFile = objLog.CreateTextFile(“C:\reportupdates.log”, True)

objLogFile.WriteLine “================================”

objLogFile.WriteLine “Starting the process”

objLogFile.WriteLine “================================”

Dim i, strTotal, intTotal, strAliasNum, arrString

‘ This query will return the objects and properties of a single successfull report

Set objMyUserInfo = iStore.Query(“SELECT TOP 100000 * from CI_INFOOBJECTS WHERE SI_INSTANCE= 1”)

for each ReportProperties in objMyUserInfo

ReportName = ReportProperties.Properties.Item(“SI_NAME”).value

ReportId = ReportProperties.Properties.Item(“SI_ID”).value

ReportKind = ReportProperties.Properties.Item(“SI_KIND”).value

ReportOwner = ReportProperties.Properties.Item(“SI_OWNER”).value

‘ ReportProgress = ReportProperties.SchedulingInfo.Properties.Item (“SI_PROGRESS”).value

If ReportKind = “CrystalReport” Then

On Error Resume Next

strTotal = ReportProperties.SchedulingInfo.Properties.Item (“SI_DEPENDENCIES”).Properties.Item(“SI_TOTAL”).value

intTotal = 0

intTotal = CInt(strTotal)

For i = 1 To intTotal

strAliasNum = CStr(i)

strMyname = ReportProperties.SchedulingInfo.Properties.Item (“SI_DEPENDENCIES”).Properties.Item(strAliasNum).value

Set objMyReportEventInfo = iStore.Query(“SELECT SI_NAME ” &_

                                        “FROM CI_SYSTEMOBJECTS ” &_

                                        “WHERE SI_ID='” & strMyname & “‘”)

                                                For Each EventProperties In objMyReportEventInfo

                                           eventid = EventProperties.Properties.Item (“SI_NAME”).value

                                                Next

If eventid = “entereventname” Then

objLogFile.WriteLine “Report ran with entereventname  –” & ReportName & “– by ” & ReportOwner

objLogFile.WriteLine “================================”

intRow = intRow + 1

End If

Next

On Error GoTo 0

End If

Next

‘ Update the changes to DB

iStore.Commit objMyUserInfo

‘Finally done.

objLogFile.WriteLine “================================”

objLogFile.WriteLine “Done. Enjoy!”

objLogFile.WriteLine “================================”

wscript.echo “Enjoy”

—————————————————————————————————————————————————-

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

    1. Animesh Kumar Post author

      Hi Swati,

      From Wiki link

      —————————————————————————————————————-

      • 2003: Acquires Crystal Decisions for $820 million.[11] Business Objects releases Dashboard Manager, BusinessObjects Enterprise 6, and BusinessObjects Performance Manager.
      • 2004: Debuts new combined company with the slogan, “Our Future is Clear, Crystal Clear.” Launches Crystal v10 and BusinessObjects v6.5.
      • 2005: Launches BusinessObjects XI. Acquires SRC Software, Infommersion, and Medience. Launches BusinessObjects Enterprise XI Release 2.

      —————————————————————————————————————-

      BO XI was launched with bundled Crystal Enterprise SDK (Crystal enterprise was a enterprise product of Crystal Decisions). Same has rolled down till current version of businessobjects.

      This  is the reason you will find names like Crystal Enterprise at places in SDK calls.

       

      I hope, you got some clarity about it.

      Regards,

      Animesh Kumar

      (0) 

Leave a Reply