Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: How to get users and member of (permission level) for a project?

$
0
0
Hi Vinay,

you can get the same through OTA code.


server = "http://xxxxx"
domain ="xxxxx"
project = "xxxxxxx"
user = "xxxxx"
password = "xxxx"

Set tdc = CreateObject("tdapiole80.tdconnection")
tdc.InitConnectionEx (server)
tdc.Login user, password
tdc.Connect domain, project
Set cust = tdc.Customization
cust.Load
Set custUsers = cust.Users
Set users = custUsers.Users
Set grps = cust.UsersGroups
Set groups = grps.Groups



Dim Excel, Sheet
Dim Row
Row = 2


Set Excel = CreateObject("Excel.Application") 'Open Excel
Excel.WorkBooks.Add() 'Add a new workbook
'Get the first worksheet.
Set Sheet = Excel.ActiveSheet

'sheet name as Users
Sheet.Name = "users"

Sheet.Cells(1, 1) = "User ID"
Sheet.Cells(1, 2) = "Full Name"
Sheet.Cells(1, 3) = "Email Address"
Sheet.Cells(1, 4) = "Group"
Sheet.Cells(1, 5) = "Phone"



For Each usr in users
grouplist = ""
For Each group in groups
If usr.InGroup(group.Name) Then
grouplist = grouplist & group.Name & ";"
End If
Next
Sheet.Cells(Row, 1).Value = usr.Name
Sheet.Cells(Row, 2).Value = usr.FullName
Sheet.Cells(Row, 3).Value = usr.Email
Sheet.Cells(Row, 4).Value = grouplist
Sheet.Cells(Row, 5).Value = usr.phone
Row = Row + 1
'f.WriteLine usr.Name & ";" & usr.FullName & ";" & usr.Email & ";" & grouplist
Next

Excel.ActiveWorkbook.SaveAs("D:\" & "Users_" & project & "_Users_List.xls")
Excel.Quit
tdc.Disconnect
tdc.ReleaseConnection

msgbox "Finished listing users Path is :" & "D:\" & "Users_" & project & "_Users_List.xls"

Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>