I
I
Ingtar2012-12-21 08:35:58
PowerShell
Ingtar, 2012-12-21 08:35:58

Password protection in powershell script

Good afternoon!
There is a task of database backup from one computer to another.
One computer in the domain, the second in the workgroup.
To connect the disk with the database, certain credentials are used (login - password).
I would like to protect these credentials as much as possible from prying eyes.
Is it possible to somehow encrypt the password used in PowerShell scripts?
so far found the use of ConvertTo-SecureString and reading data from a file. But there the password is also stored in clear text ... Here is such a trick ...

Answer the question

In order to leave comments, you need to log in

5 answer(s)
U
uksus, 2013-01-10
@Ingtar

And the password should be in open form or protected (SecureString)?

I
ixSci, 2012-12-21
@ixSci

Try looking towards the crypto API
www.sysadmins.lv/PermaLink ,guid,1cec0947-9113-4de2-bf48-809a09849f4c.aspx

N
Nikolai Turnaviotov, 2012-12-23
@foxmuldercp

I solved the problem of logging in to the shares of a non-domain home machine from a domain laptop brought home simply - if the loginname + password pair matches on both machines, the user is considered authentic and authorized, i.e.
local-non-domain-pc1\username + "password" = domain-pc2\username + "password"
and even gets admin privileges if they are available.

I
Ingtar, 2013-01-10
@Ingtar

I didn’t think about encrypting the file itself ...
But I used the same construction) It’s just embarrassing that by copying the $File file, you can do the same on any other computer.

M
Maxim Yaroshevich, 2019-07-12
@YMax

As a solution - ps2exe, an example of using .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question