I guess you do not really need to encrypt/decrypt RDP password, but rather want to connect to a remote machine without getting username/password prompt, do you? If so you can try to launch the RDP app, fill in all required parameters, including password, and save connection in .RDP file, and then pass the connection file as a parameter to the mstsc.exe
I created an .RDP file with the connection. But when I open the .RDP file with mstc.exe. I got an error message "The system doesn't authorize saved reference" So we need to decrypt RDP password if we want to start aan RDP connection from an .RDP file from NAV2017.
I think your approach is bad:
1. RDP file resides on client (probably) and you have to send it to server
2. Your approach is a kind of hack
3. If you forgot the password, recreate it on target system
4. If you saved password as another user, you will be probably restricted use it as NAV user
5. You probable don't need use a rdp connection from within NAV (from code) and if you mean it as a help for user, user can write the password manually.
@lubost mstsc can only be started at the client side, therefore the .NET var will be accessing RDP files local to the PC/user.
But I agree with you, this is not the right approach. If something can be done in NAV it does not necessarily mean it should be done. This particular solution (starting RDP from NAV) has many potential points of failure, and all this extra code/work will backfire in form of extra support (I can easilly imagine users moaning : NAV does not work because one cannot connect to remote machine or saved password expired), when it comes to hiring external support/consultants, and also at the time of the upgrade to some next version.
But new NAV developers needs to learn this hard way.
I remember my own first 'customisations' - when my client insisted to have, on the standard Customer Dard form, the Global Dimension 2 field displayed above the Global Dimension 1 field. Easy, right? - just edit the form and switch the fields .
Answers
I guess you do not really need to encrypt/decrypt RDP password, but rather want to connect to a remote machine without getting username/password prompt, do you? If so you can try to launch the RDP app, fill in all required parameters, including password, and save connection in .RDP file, and then pass the connection file as a parameter to the mstsc.exe
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
You have no choice anyway' I'm afraid.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
1. RDP file resides on client (probably) and you have to send it to server
2. Your approach is a kind of hack
3. If you forgot the password, recreate it on target system
4. If you saved password as another user, you will be probably restricted use it as NAV user
5. You probable don't need use a rdp connection from within NAV (from code) and if you mean it as a help for user, user can write the password manually.
But I agree with you, this is not the right approach. If something can be done in NAV it does not necessarily mean it should be done. This particular solution (starting RDP from NAV) has many potential points of failure, and all this extra code/work will backfire in form of extra support (I can easilly imagine users moaning : NAV does not work because one cannot connect to remote machine or saved password expired), when it comes to hiring external support/consultants, and also at the time of the upgrade to some next version.
But new NAV developers needs to learn this hard way.
I remember my own first 'customisations' - when my client insisted to have, on the standard Customer Dard form, the Global Dimension 2 field displayed above the Global Dimension 1 field. Easy, right? - just edit the form and switch the fields .
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03