I first postd this through google, but it looks like it didn't go through.
Sorry if this gets duplicated.

================================================== ==========

I've been working on an app that will loop through groupwise users,
login with the trusted app api and make some changes to their address
books. The method that actually does the work works perfectly if I do
something like create a button and call it like

However, when I try to pass usernames by looping through post office
users(generated from the admin object api) and use the multilogin
method, it always seems to want to work on the first username that I
pass in and then every other time it keeps that user name. I've tried
everything I can think of to reinitialize the application and account
objects but nothing seems to work.

Here's the code I currently have. The UserName variable is what is
passed into this function.

acc = gwApp.MultiLogin(UserName, "/ipa=" + PostOfficeIP +
" /ipp=" + PostOfficePort, Type.Missing,
GroupwareTypeLibrary.LoginConstants.egwNeverPrompt , Type.Missing)
MessageBox.Show("failed: " + UserName)
End Try

So if the first username passed in is jdoe, every time I run this, it
only looks at jdoe's address books. I basically need a logout function, but
can't seem to figure out a way to do that.

Any suggestions on how to get around this?