Store a text in encrypted form and use in powershell script without compromising it to other users?



i want encrypt text want use in different powershell script without compromising security other user using scripts contain text. want conceal text , use without hassle powershell scripts using particular text. text can stored in file used in different scripts. have tried basic things :

  $text = read-host "enter text" -assecurestring    $bstr = [system.runtime.interopservices.marshal]::securestringtobstr($text)    $plaintext = [system.runtime.interopservices.marshal]::ptrtostringauto($bstr)  write-host "text is: " $plaintext    

but thing can found if in same computer. need foolproof method if any. first question please ignore mistakes, if any.

please visit below link more details

stackoverflow.com/questions/42801713/store-a-text-in-encrypted-form-and-use-in-powershell-script-without-compromising

hi ankit,

you can store encrypted password in text file or in registry too. take @ below urls

https://gallery.technet.microsoft.com/scriptcenter/encrypt-password-and-use-dd07f253

https://blogs.technet.microsoft.com/undocumentedfeatures/2015/10/01/storing-powershell-credentials-in-the-local-user-registry/


thanks, samer please take moment "vote helpful" and/or "mark answer" applicable. helps community, keeps forums tidy, , recognizes useful contributions. thanks!



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file