Convert secure string to string

As I did not manage to get specific support from UiPath in this matter, I am reaching out to my technical connections.
I am facing a situation with a robot that needs to access the credentials stored as “Generic” type in Windows Credential Manager. After the initial access they are changed to “Windows Credentials” type and I can’t access them anymore, more precisely I can’t convert the password from secure string to string anymore with the command “new System.Net.NetworkCredential(string.Empty, secureStr).Password”. Can anyone please assist me with this?

Hi @jimmynastase1

you can use the package uipath.credentials.activities to handle this in a easy way.
There are the activities Get Secure Credential and another one to type the secured string into a field.

Hi @RoboHeart,
That’s exactly what I am using. From “Generic” type I can get them with no problems but I have to get them from “Windows Credentials” type. I need to convert the secure string to string because I have to type it into a command prompt. I know about Orchestartor Credentials also but as per company policy we can’t store VM credentials there.

@jimmynastase1

Check below post for your reference

Hope this helps you

Thanks

I’ve read all the documentation regarding Credential Manager Activities and was not able to find an answer to my issue.

Ou…sorry. I misunderstood.

Why does the type was changed from Generic to Windows Credentials?

@RoboHeart,
I have no idea.

I don’t believe secureString to String is possible. You would literally decrypt your password. That would violate literally everything.

Sorry :frowning:

1 Like

hi @jimmynastase1,

You can do this

StrVar =new System.Net.NetworkCredential(“”, SecureStrVar).Password

Cheers

2 Likes

Interesting. Thank you. And I thought this is not allowed.
Actually I think it should not be allowed.

@Pradeep_Shiv
Did you read my post? I just said i’m using the same command but it doesn’t work when getting Windows Credentials instead of Generic Credentials.

@jimmynastase1

Check as below

I am able to retrive without any problem

Windows credential store

Hope this helps you

Thanks

@Srini84
As I said two times, I am able to do that aswell if they are stored under Generic Credentials, I need to retrieve them if they are Windows Credentials, the section above Generic Credentials in Windows Credential Manager.

It’s not working for me :roll_eyes:

1 Like

Hi @hsendel,
What’s the error?

1 Like

try

new System.Net.NetworkCredential(String.Empty, SecureStrVar).Password

Hello @Pradeep_Shiv . Thanks for reply. Please find bellow the error (XAML file attached):

Main.xaml (4.6 KB)

Thanks @jack.chan , I tried and got bellow error ( as per attachmentMain.xaml (4.6 KB) )

your password variable should be a string instead of SecureString

then in the messagebox you can simply print password
image

Thanks for prompt feedback, but when I change this I got another error :