Are there any updates on the SDK documentation? Our organization uses Remote Desktop Manager for all of our managed devices, and I'm trying to get RDM's database tied in with a new set of server management scripts for the servers we manage so that we can maintain one copy of usernames and passwords. Using Powershell for the scripts, and I managed to get the assembly loaded without issue. I can list the methods, and can execute RemoteDesktopManager.AddOn.AddOnServices.Equals() without issues, but if I try Encrypt() or Decrypt(), I get an exception that "Object reference not set to an instance of an object."
I've read through the available code for the SQL add-on, and there doesn't look to be anything special about calling those methods, though I come from a C background in programming, not .NET. Am I missing some initialization code somewhere? Below is the code I'm running.
$asm = [Reflection.Assembly]::LoadFrom("C:\users\administrator\desktop\rdm\lib\RemoteDesktopManager.AddOn.dll")
[RemoteDesktopManager.AddOn.AddOnServices]::Encrypt( "a", "a" ) #Fails with above exception
[RemoteDesktopManager.AddOn.AddOnServices] | get-member -static #Outputs list of defined methods with their definitions
PS H:\> C:\Users\administrator\Documents\ManagedServerScripts\RDM-test.ps1
Name MemberType Definition
---- ---------- ----------
Decrypt Method static string Decrypt(string aEncryptedValue, string aAddID)
Encrypt Method static string Encrypt(string aValue, string aAddID)
EnsureConfiguredInstallationPath Method static bool EnsureConfiguredInstallationPath(string aApplicationName)
Equals Method static bool Equals(System.Object objA, System.Object objB)
GetInstallationPath Method static string GetInstallationPath(string aApplicationName)
Init Method static System.Void Init(RemoteDesktopManager.AddOn.IAddOnServices aAddOnServices)
LogDebug Method static System.Void LogDebug(string aMessage)
LogDebugError Method static System.Void LogDebugError(System.Exception aException)
LogError Method static System.Void LogError(System.Exception aException), static System.Void LogErr...
LogInfo Method static System.Void LogInfo(string aMessage)
LogSilentError Method static System.Void LogSilentError(System.Exception aException)
ReferenceEquals Method static bool ReferenceEquals(System.Object objA, System.Object objB)
RegisterInstallationPath Method static System.Void RegisterInstallationPath(string aDescription, string aName, stri...
Exception calling "Encrypt" with "2" argument(s): "Object reference not set to an instance of an object."
At C:\Users\administrator\Documents\ManagedServerScripts\RDM-test.ps1:9 char:52
+ [RemoteDesktopManager.AddOn.AddOnServices]::Encrypt <<<< ( "a", "a" )
+ CategoryInfo : NotSpecified: ( , MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
It's not possible to use the SDK in PowerShell. The AddOnServices class is initialized by the application and this is why you get the object not set to an instance. To Create an AddOn, you must use Visual Studio 2008 and compile a dll.
For security reason, it's not possible to extract password from an external application.
Thanks for the quick response. I was hoping to be able to tie in to the pre-existing password database, but I guess I'll just have to maintain another database and train users to keep them both in sync.
It's possible to set the password in command line. maybe you take a look at it.
Setting the password is only half the battle. I'd also need to be able to verify (via plaintext or some hash) the password my database has, otherwise the databases could get out of sync without me being able to know. My hope was to use RDM's database entirely, but that is unfortunately impossible.
I didn't think of this yesterday, but using the SDK, would it be possible to add a new data source type and/or override the key/algorithm used to encrypt passwords? If I went that route, I should be able to change the encryption used in the database to something I know.
The encryption provider SDK will be available in the version 6.0. In the version 5.9, we will allow you to choose different type of encryption and when the mechanism is stable enough, we will expose it as an AddOn