Hi, we need to update all our Vault user names and I'd like to write a quick utility to do this rather than having to manually change all the user names in the Vault Admin tool. I've got it to where it will change the user login, but the login will not work until I go into the Admin tool, open the new user and save it from there.
The code I've got which performs the update looks like this (vU is a VaultUser object):
vU.Login = NewLoginName;
bReturn = this.client.Connection.EditUser(vU);
Just wondering what else it is I need to do to make this work. Thanks!
Editing Vault users through API
Moderator: SourceGear
Re: Editing Vault users through API
How are you managing the Login process? Are you using the VaultClientIntegration wrappers?
The reason I ask, is I don't know how that will work. The Edit User API is found in the Admin Web Services. To get there through the API, the Client Instance needs to be initialized with AccessLevelType.Admin.
I think there is a Login() command which lets you specify Admin Access level, make sure to use AccessLevelType.Admin.
The reason I ask, is I don't know how that will work. The Edit User API is found in the Admin Web Services. To get there through the API, the Client Instance needs to be initialized with AccessLevelType.Admin.
I think there is a Login() command which lets you specify Admin Access level, make sure to use AccessLevelType.Admin.
Jeff Clausius
SourceGear
SourceGear
Re: Editing Vault users through API
Well I got it to mostly work. Yeah I am logging in with the AccessLevelType.Admin to access the user list, what I needed to do was to update the password along with the login name. All I can seem to do is null the password since the API doesn't seem to want to retrieve the existing password from the system, but that's ok for our purposes since none of our users besides the Admin user has a password anyhow.
Re: Editing Vault users through API
Glad you got it working.
BTW, if you set the VaultUser's Password member to null, it should remain unchanged through the call to EditUser().
BTW, if you set the VaultUser's Password member to null, it should remain unchanged through the call to EditUser().
Jeff Clausius
SourceGear
SourceGear