cancel
Showing results for 
Search instead for 
Did you mean: 

Need script to disable selected users in BOEXI 3.1

0 Kudos

Hi,

I am looking for a script to disable selected users. I have a query builder query which I want to use in that script to disable users.

SELECT SI_NAME, SI_LASTLOGONTIME, SI_CREATION_TIME FROM CI_SYSTEMOBJECTS WHERE SI_NAME NOT IN ('ADMINISTRATOR','GUEST') AND SI_KIND='USER' AND SI_CREATION_TIME <= '2012.12.31' AND SI_LASTLOGONTIME IS NULL ORDER BY SI_NAME

Please help.

Regards,

Lokesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lokesh,

You can use the attched script to disable users as per your query builder query.

You would need to update the query in the code.

Place it as a .jsp file in AdminTools application context or create your own WAR to run the file.

Thanks,

Prithvi

0 Kudos

Hi Prithvi,

Thanks for script. Please let me know steps to create watr file.

Regards,

Lokesh

Former Member
0 Kudos

Hi Lokesh,

Below are the steps to create and deploy a  WAR in tomcat.

1. Go to Tomcat Installation Directory. (C:\Program Files\Business Objects\Tomcat55)

2. Go to webapps folder in tomcat directory (C:\Program Files\Business Objects\Tomcat55\ webapps).

3. Create a new application folder within webapps (ex. Test)

4. Create a new folder named ‘WEB-INF’ within ‘Test’ Folder. (C:\Program Files\Business Objects\Tomcat55\ webapps \Test\WEB-INF)

5. Copy the ‘lib’ folder from the mentioned location: (C:\Program Files\Business Objects\Common\4.0\Java\lib) and paste it to (C:\Program Files\Business Objects\Tomcat55\Webapps\Test\WEB-INF\lib)

6. Place your all jsp files at the following location (C:\Program Files\Business Objects\Tomcat55\Webapps\Test\index.jsp)

7. Restart tomcat and run the code in browser (http:\\localhost:8080\Test\index.jsp).

If you use any other app server let us know.

Thanks,

Prithvi

0 Kudos

Received following error:


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /disableuser.jsp:52

49:     Object[] objs = boAliases.toArray();
50:  
51:     // Get the first one
52:     IUserAlias myAlias = (IUserAlias)objs[0];
53:  
54:     // and disable it
55:     myAlias.setDisabled(true);


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.ArrayIndexOutOfBoundsException: 0
org.apache.jsp.disableuser_jsp._jspService(disableuser_jsp.java:100)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I restarted tomcat and cleared cache as well.

Regards,

Lokesh

Former Member
0 Kudos

Run the script for a single user and let me know if it works?

Thanks,

Prithvi

Former Member
0 Kudos

Also use '*' in the query and check the results.

Thanks,

Prithvi

0 Kudos

Thanks for help Prithvi. It worked. It needs SI_ALIASES in select list so I used * to select instead property bags.

0 Kudos

Hi Prithvi,

Also, please help to add print statement to notify which users are disabled post running the script.

Regards,

Lokesh

Former Member
0 Kudos

Find the attched code which displays the names.

Thanks,

Prithvi

Answers (0)