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 @cKsB,
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.


Check below post for your reference

Hope this helps you


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?

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


1 Like

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

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.


Check as below

I am able to retrive without any problem

Windows credential store

Hope this helps you


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.