tag:blogger.com,1999:blog-7751447442026377325.post8924640513225158593..comments2023-10-23T22:25:46.368+02:00Comments on Oracle Business Intelligence OBIEE 101: OBIEE Get all users and roles from RPDJohn Minkjanhttp://www.blogger.com/profile/08228393663535024706noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7751447442026377325.post-37671515886424214642011-11-22T21:19:58.677+01:002011-11-22T21:19:58.677+01:00To future users, the original script would not run...To future users, the original script would not run as written due to some line break issues with the If loops. To save you headaches if this ever comes up, here is a revision of the code that should work if you copy paste into a text file and rename it to .vbs:<br /><br />'''''''''''''''''''''''''''''''''<br />'Read_Usergroups.VBS'John Minkjan'http:// http://www.obiee101.blogspot.com/<br />'Get all the users from a repository<br />'1: Make an UDML export of the PRD using nqgenudml.exe<br />'2: Change the filename/location in this script<br />'3: Run the script from the command line cscript Read_Usergroups.VBS > users.txt<br />'4: Put the export in a XLS Pivot table<br /><br />Const ForReading = 1<br />Set objFSO = CreateObject("Scripting.FileSystemObject")<br /><br />'point this to your UDML EXPORT<br />Set objFile = objFSO.OpenTextFile("C:\YourFileNameHere.txt", ForReading)<br /><br />Dim arrFileLines()<br />Dim strRLine<br />Dim strTemp1<br />Dim strTemp2<br />Dim strTemp3<br />Dim intRoles<br />intRoles = 0<br />i = 0<br /><br />WScript.Echo "USER_NAME;FULL_NAME;ROLE;COUNT"<br /><br />Do Until objFile.AtEndOfStream<br /> strRLine = objFile.ReadLine<br /> If Left(strRLine, 12) = "DECLARE USER" Then<br /><br /> ReDim Preserve arrFileLines(i)<br /> strTemp1 = Mid(strRLine, 15, 50)<br /> strTemp1 = Mid(strTemp1, 1, InStr(strTemp1, """") - 1)<br /> <br /> If InStr(strRLine, "}") > 0 Then<br /> strTemp2 = Mid(strRLine, InStr(strRLine, "{") + 1, (InStr(strRLine, "}") - (InStr(strRLine, "{") + 1)))<br /> Else<br /> strTemp2 = ""<br /> End If<br /> <br /> arrFileLines(i) = strTemp1 & ";" & strTemp2<br /> intRoles = 1<br /> i = i + 1<br /><br /> End If<br /> <br /> <br /> If intRoles >= 1 Then<br /><br /> If InStr(strRLine, "HAS ROLES (") > 0 Then<br /> intRoles = 2<br /> End If<br /><br /> If intRoles = 2 And InStr(strRLine, "HAS ROLES (") = 0 Then<br /> strTemp3 = Mid(strRLine, InStr(strRLine, """") + 1, 50)<br /> strTemp3 = Mid(strTemp3, 1, InStr(strTemp3, """") - 1)<br /> WScript.Echo arrFileLines(i - 1) & ";" & strTemp3 & ";1"<br /> End If<br /><br /> If intRoles = 2 And InStr(strRLine, ")") > 0 Then<br /> intRoles = 0<br /> End If<br /><br /> End If<br />Loop<br />objFile.CloseOwenhttps://www.blogger.com/profile/05605315494175638489noreply@blogger.comtag:blogger.com,1999:blog-7751447442026377325.post-81981016971279869042009-06-26T08:06:52.897+02:002009-06-26T08:06:52.897+02:00@Arghya
VBS => Visual Basic Script
regards
J...@Arghya<br /><br />VBS => Visual Basic Script<br /><br />regards<br /><br />JohnJohn Minkjanhttps://www.blogger.com/profile/08228393663535024706noreply@blogger.comtag:blogger.com,1999:blog-7751447442026377325.post-75356973842911382292009-06-25T18:50:29.671+02:002009-06-25T18:50:29.671+02:00A Basic Quesion. What language is this?A Basic Quesion. What language is this?Arghya Royhttps://www.blogger.com/profile/07097600754566930159noreply@blogger.com