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
Post a Comment