Can you encrypt a password directly into a powershell script

Afternoon all,

Can you encrypt a password directly into a PowerShell script and then send that script to someone else for them to run it, so it'll then use your rights in order to run WITHOUT putting the password in on their machine?

I've looked and can't get a clear answer, I'm guessing the answer is no.

Regards
Alex
LVL 15
Alex Green3rd Line Server SupportAsked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
everything is crackable in the hands of somebody who really wants to access it. I would be more worried about the "someone else" reusing the credentials file for something else!
0
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
I am using a technique so save credentials for jobs running on a server. Have a look at http://emoreau.com/Entries/Articles/2016/11/PowerShell-Get-O365-mailboxes-statistics.aspx and do not forget to read the comment at the bottom of the article.
0
 
ste5anConnect With a Mentor Senior DeveloperCommented:
Sure, you can. But it is not safe (very secure).

What is you use-case?
0
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
Alex Green3rd Line Server SupportAuthor Commented:
Is it easily crackable then if I store the password in there?

Thanks
Alex
0
 
Alex Green3rd Line Server SupportAuthor Commented:
good point well presented.

Thank you
0
 
Alex Green3rd Line Server SupportAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.