Com+ applications automate username and password

i am trying to create a vb6 application that will update com+ applications username and password. i am using a multiselect listbox to select the application name to update. i have no problem updating one application but problem occur when trying to update more than one. i think my main problem is referencing the application NAME with the application ID    
enterpriseirelandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EDDYKTCommented:

Public Sub ChangeSecurity(ByVal MTSName As String, ByVal username As String, ByVal Password As String)
    Dim catalog As New MTSAdmin.catalog
    Dim packages As MTSAdmin.CatalogCollection
    Dim package As MTSAdmin.CatalogObject
    
    On Error Resume Next
    Set packages = catalog.GetCollection("Packages")
    packages.Populate
 
    For Each package In packages
        If UCase(package.Value("Name")) = UCase(MTSName) Then
            Exit For
        End If
    Next
    
    If package Is Nothing Then Exit Sub
    package.Value("Identity") = username
    package.Value("Password") = Password
    package.Value("SecurityEnabled") = "Y"
    packages.SaveChanges
    Set package = Nothing
    Set packages = Nothing
    Set catalog = Nothing
End Sub

Open in new window

0
enterpriseirelandAuthor Commented:
how would i be able to implement this to work with a listbox with multiple applications selected. i want to be able to update more than one application at a time, as i said i have no problem updating one application for a listbox, the problem occur only with multiple applications
0
EDDYKTCommented:
just pass your applicaton name into the function as MTSName

i assume you list all application on the list box


Dim i As Integer
 
For i = 1 To List1.ListCount
    If List1.Selected(i - 1) Then
        ChangeSecurity List1.List(i - 1), "", ""
    End If
Next

Open in new window

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

enterpriseirelandAuthor Commented:
this seem to create new applications with the same names as which is selected in the listbox
0
EDDYKTCommented:
i don't see any line on my code to create a new application.

Post your code otherwise it is hard to know what's wrong
0
enterpriseirelandAuthor Commented:
Dim catalog As New MTSAdmin.catalog
    Dim packages As MTSAdmin.CatalogCollection
    Dim package As MTSAdmin.CatalogObject
    Dim i As Integer
 
    Set packages = catalog.GetCollection("Packages")
    packages.Populate

For Each package In packages
 
For i = 1 To lstApplications.ListCount
    If lstApplications.Selected(i - 1) = True Then
        MsgBox lstApplications.List(i - 1)
    package.Value("Identity") = "-------"
    package.Value("Password") = "------"
 
       
    End If
Next

    Next
0
EDDYKTCommented:
For i = 1 To lstApplications.ListCount
    If lstApplications.Selected(i - 1) = True Then
        MsgBox lstApplications.List(i - 1)

If UCase(package.Value("Name")) = UCase(lstApplications.List(i - 1)) Then  'add this
    package.Value("Identity") = "-------"
    package.Value("Password") = "------"


  package.Value("SecurityEnabled") = "Y"  'add this

    packages.SaveChanges  'add this
  end if        'add this
    End If
Next
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EDDYKTCommented:
you never compare the package's name with your application name before setting the password and user name
0
enterpriseirelandAuthor Commented:
thank very much, it worked perfect
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.