From my reading of the documentation for MemberService.updatepassword(), an authenticated user with user administration rights should be able to call this method to update a password without knowing the original password:
I'm not quite sure what happened to that post, a lot of content got removed. Anyway, the documentation suggests that a connected user with "User Administration" privs should be able to make the MemberServices.updatepassword() method work without the oldpassword ... however I can't make that happen, even the Admin user requires the correct oldpassword of the requested account in order to allow this call to succeed. Has anybody gotten this call to work to set a password without knowing the "old password" using CS 10?
Hi Dave,
private void UpdtPaswd() { OTAuthentication OTAuth = new OTAuthentication(); OTAuth.AuthenticationToken = AuthToken; DocumentManagementClient docMan = new DocumentManagementClient(); MemberServiceClient membrClient = new MemberServiceClient(); try { membrClient.UpdatePassword(OTAuth, 44571, "test1", null); Console.WriteLine("Password Updated!"); } catch (FaultException e) { Console.WriteLine("Failed: " + e.Code.Name, e.Message); return; } finally { membrClient.Close(); } }
Hi and thanks for the reply, unfortunately it wasn't as helpful as you'd hoped.
Your code mirrors that of the documentation and the code I'm using, but it doesn't work, not even when I use "Admin" as the authenticated user. If I don't have the correct oldpassword included, the call fails. This is in both CS10.5 Beta 4 as well as CS10 service pack 2.
At least i know I'm not doing anything wrong :-)
Here is the paired down function, $oldpassword=$null when the code fails ... I can show you the auth code if you like but it is standard, basic authenticateuser('user','pass'). This is powershell, btw. I've tried the call in various ways, with and without $oldpassword supplied, explicitly setting it to $null, even providing a bogus string but always the same result unless I omit $oldpassword entirely and then I get a "can't find overload for updatepassword with 2 arguments" The error returned is: Exception calling "UpdatePassword" with "3" argument(s): "Error changing the user's password. [E662306821]" At Z:\GATE\src\DesktopLibrary\DesktopLibrary.ps1:1175 char:39 + try {$script:sotmember.updatePassword <<<< ($userid.ID, $newpassword, $oldpassword)} + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException and the function is called like setPassword('Test', 'LiveLink42'): Function setPassword($user, $newpassword, $oldpassword) { try { if (! ($userid = $script:sotmember.getMemberByLoginName($user))) { LogMessage "User ($user) not found on system, aborting setPassword" $errmsg_E_NO_USER $LOG_ERR return $errmsg_E_NO_USER } } catch [System.Exception] { Write-Error "Failure while truing to determine member ($user) id because $($Error[0].Exception.Message)" return $ERRMSG_E_APPLICATION } try {$script:sotmember.updatePassword($userid.ID, $newpassword, $oldpassword)} catch [System.Exception] { Write-Error "Could not update password for $user because $($Error[0].Exception.Message)" return $errmsg_E_APPLICATION } return $null }
I don't know who is responsible for this browser-based editor but it sucks! Try number 4 ...
This is powershell v2 with Net 4 framework, I call the function like
setPassword 'Test' 'LiveLink42'
I use authenticateuser('user','Password') semantics
The error message I receive is:
Exception calling "UpdatePassword" with "3" argument(s): "Error changing the user's password. [E662306821]"At Z:\GATE\src\DesktopLibrary\DesktopLibrary.ps1:1175 char:39+ try {$script:sotmember.updatePassword <<<< ($userid.ID, $newpassword, $oldpassword)} + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
And the function is:
Function setPassword($user, $newpassword, $oldpassword) { try { if (! ($userid = $script:sotmember.getMemberByLoginName($user))) { LogMessage "User ($user) not found on system, aborting setPassword" $errmsg_E_NO_USER $LOG_ERR return $errmsg_E_NO_USER } } catch [System.Exception] { Write-Error "Failure while truing to determine member ($user) id because $($Error[0].Exception.Message)" return $ERRMSG_E_APPLICATION } try {$script:sotmember.updatePassword($userid.ID, $newpassword, $oldpassword)} catch [System.Exception] { LogMessage "Could not update password for $user because $($Error[0].Exception.Message)" $ERRMSG_E_APPLICATION $LOG_ERR Write-Error "Could not update password for $user because $($Error[0].Exception.Message)" return $errmsg_E_APPLICATION } return $null}
Hi,
I have tested and sent the same working code.
FYI, the browser-based editor used here is this one:
http://ckeditor.com/
Not sure how you are submitting text but I don’t seem to have similar issues using IE 10 as my browser.
Thanks Kyle ... I use firefox, perhaps that is the difference but probably just user error ... I'm far more used to TinyMCE and I guess I expected them to be similar. The bigger problem I had was in trying to add an attachment, no matter whether "Desktop" or "Content Server" attachment, I kept getting "Error adding version" messages ... probably not an editor issue but frustrating just the same.
Hi Jason, this is what Fiddler returns from this call
$script:sotmember.updatePassword($userid.ID, $newpassword, $null)
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><OTAuthentication xmlns="urn:api.ecm.opentext.com"><AuthenticationToken>Rf3u9Sg9hPhEdhRFnIFYNyXwYVBeyflvRS1OGwEwaWpZ%2BVwh%2FRXQ19acedVcZ2YopNVssyyUr6OcQkEN2ao%2F2w%3D%3D</AuthenticationToken></OTAuthentication></soap:Header><soap:Body><UpdatePassword xmlns="urn:MemberService.service.livelink.opentext.com"><memberID>51791</memberID><newPassword>LiveLink42</newPassword><oldPassword /></UpdatePassword></soap:Body></soap:Envelope>
Indeed, I noticed that <oldpassword /> token as well ... seems I'm a bit stuck here but not alone.
I can't really say why the following works but I found other powershell authors having similar problems sending $NULL and it is possible to invoke methods more directly, to whit:
$sotmember.gettype().getmethod("UpdatePassword").Invoke($sotmember,@($userid.ID, $newpassword, $null))
So, not so stuck after all :-)
Thanks again, Jason, you got me looking in the right direction
I think I may be the only powershell user of CWS but just in case ... the updateMember call ended up giving me the same problem as the updatepassword call did, sending the empty string rather than NULL, but this time as a property of a Member as opposed to a parameter in the call. That meant that the same "Invoke()" trick wouldn't work. Thus I did more digging and found out that Powershell V3 provides an ability to explicitly set something to NULL though in true Microsoft fashion, it isn't by using $null but the rather arcane:
[System.Management.Automation.Language.NullString]::Value
That exact string needs to be used whereever a true NULL value is required. If I set Member.Password = $null Content Server complains about the password not meeting regulations (clearly trying to set it to the empty string) but using the above string then the property isn't sent at all and Content Server understands not to try to change the password.
The only other thing I'll say is that Powershell Version 3 is not standard and typically not installed on Windows computers and the above value is not available in V2.
I’m not too familiar with Powershell, but can you just set some variable like NullStr = [System.Management.Automation.Language.NullString]::Value, and then use “NullStr” everywhere to simplify your code?
Hi Kyle
Yes of course you can assign the "NullString" to a variable and use that, it doesn't really simplify the code however as there is really only one place (so far at least) that I need the value. But sure, Powershell allows you to do as you suggest (which only begs the question as to why Microsoft didn't provide such a variable to begin with :-)).
Dave