How to loop through Domains and all the Projects in each Domain for extracting Information from ALM!!

Posted: January 31, 2014 in Uncategorized

I have used this VBScript in the past to get the TDAdmins of all active projects (assuming your user is present in all of them):

user = InputBox("User:")
password = InputBox("Password:")
servername = InputBox("Server name:")

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\listAdminUsers.txt", 8, True)
Set tdc = CreateObject("tdapiole80.tdconnection")
tdc.InitConnectionEx ("http://" & servername & ":8080/qcbin")
tdc.Login user, password
Set domainList = tdc.VisibleDomains

For Each dom in domainList
f.WriteLine "*************************** " & dom & " ***************************"
For Each proj In tdc.VisibleProjects(dom)
tdc.Connect dom, proj
f.WriteLine "----------------------- " & proj & " -----------------------"
Set cust = tdc.Customization
Set custUsers = cust.Users
Set users = custUsers.Users

For Each usr in users
If usr.InGroup("TDAdmin") Then
f.WriteLine usr.Name
End If
Set cust = Nothing
Set custUsers = Nothing
Set users = Nothing

Set domainList = Nothing
Set fso = Nothing
Set f = Nothing
Set tdc = Nothing
MsgBox "Finished listing users"

Above code looks promising!!!!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s