That’s why we want a compliance script with ConfigMgr, there is no .ps1 file, 
no content, it’s just runs in memory and bits of it may be logged but not the 
entire thing.

Yeah I think that may be our best option. Working through the examples below.

http://get-powershell.com/post/2008/11/11/Encrypting-and-Decrypting-Strings-with-a-Key-in-PowerShell.aspx

Daniel Ratliff

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Ryan
Sent: Tuesday, July 22, 2014 11:35 AM
To: scripting@lists.myitforum.com
Subject: Re: [scripting] PowerShell to store password securely in a script?

Ah, I see.

Thinking this through logically, do you think you could do it securely with a 
plain text script? If anyone got their hands on the script, they would have 
whatever password you specified since the code is there to use it.

If you want to do it, you can specify the key in ConvertTo-SecureString.

http://stackoverflow.com/questions/15580523/powershell-secure-password-to-work-on-any-machine



On Tue, Jul 22, 2014 at 10:16 AM, Daniel Ratliff 
<dratl...@humana.com<mailto:dratl...@humana.com>> wrote:
But I cannot take that securestring and deploy it to thousands of workstations. 
Its only valid on the machine/account its created on/with.

Daniel Ratliff

From: listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com> 
[mailto:listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com>] 
On Behalf Of Ryan
Sent: Tuesday, July 22, 2014 11:09 AM
To: scripting@lists.myitforum.com<mailto:scripting@lists.myitforum.com>
Subject: Re: [scripting] PowerShell to store password securely in a script?

$Test = Read-Host -AsSecureString
$Test | ConvertFrom-SecureString | Out-File "c:\test.txt"

This will give you the encrypted password. To use that password, you just need 
to store it to a variable and use COnvertTo-SecureString


On Tue, Jul 22, 2014 at 9:55 AM, Daniel Ratliff 
<dratl...@humana.com<mailto:dratl...@humana.com>> wrote:
I feel like I am missing something glaringly obvious here.

I have two requirements:

1.       Store the password in the script, but not in plain text

2.       Use a single script with nothing external

Is there no way with PowerShell to store an encrypted password in a script and 
re-use that on multiple machines?

Daniel Ratliff


The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.




The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.




The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material.  If you receive this 
material/information in error,
please contact the sender and delete or destroy the material/information.

Reply via email to