locked
PowerShell Password Encription. RRS feed

  • Question

  • I log in to windows 2008R2 as user A and I execute the below powershell script

    ################################################################

    $credential = Get-Credential
    $credential.Password | ConvertFrom-SecureString | Set-Content e:\ow.txt

    ################################################################

    This generates encrypted password in e:\ow.txt. This password encrypted string i can use any powershell program using below line.

    $password = Get-Content e:\ow.txt  | ConvertTo-SecureString -AsPlainText -Force

    Question: This secure string only works when i log in as user A. If I log in as user B it wouldn't work. Is there any mechanism where this secure string should work with any user ?

    Thanks in advance.

    Tuesday, March 4, 2014 3:38 PM