How to convert SecureString to String: Password from Orchestrator credentials

Need help on this. Please see screenshot below
UiPath%20Error

I used what I saw on other topics
String acme_password = new system.Net.NetworkCredential(string.Empty,Password_acme).Password

but still same error occurs.
"Compiler error(s) encountered processing expression “acme_password”. Value of type ‘System.Security.SecureString’ cannot be converted to ‘String’.

Dont know what to do now.

Kindly enlighten me more.

Thank you!

3 Likes

Please enter the following expression. Exactly as shown below -

(new System.Net.NetworkCredential("", mySecureString,)).Password

In place of mySecureString, replace with your secure string - Password_acme

7 Likes

follow below link

Hi @vonswanity

Welcome to the community!! :smiley:
I have a sample workflow which converts a string to secure string (represents Orchestrator password), and secure string back to normal string.

Check this out… It should help you…

Secure String Sample.xaml (5.9 KB)

If this helps you, please make sure to mark my answer as the solution too :slight_smile:

Let know how it goes…

5 Likes

I hope this will help you

Hi @vonswanity

Kindly use below expression for showing secure password.
string password =
new System.Net.NetworkCredential(string.Empty,securePassword).Password

3 Likes

It worked Thankyou :slight_smile:

1 Like

Here is a detailed article on that :slight_smile: