title: ConvertTo-SecureString Key not valid for use in specified state
body: <p>I'm getting an error when running a script as a particular user, but not as my own user account. This is on Windows 2012R2. Powershell module was installed and has been in use for some time, but using another account prevents it from running. Because I have been able to run it, I feel like I can rule out any missing files or faulty commands within the script. The rest of the script is dependent on this. I also have run the convertto-securestring options using the service account that will be running the commands through the automation, but it still is not working.</p>
  
  <p>This is the secure password script I ran to convert the password</p>
  
  <pre><code>$password = "password"
  $secureStringPwd = $password | ConvertTo-SecureString -AsPlainText -Force 
  $secureStringText = $secureStringPwd | ConvertFrom-SecureString 
  Set-Content "E:\temp\ExportedPassword.txt" $secureStringText`
  </code></pre>
  
  <p>This is the error message after trying to run as user B</p>
  
  <pre><code>line 4 $pwdTxt = Get-Content "E:\temp\ExportedPassword.txt"
  line 5 $securePwd = $pwdTxt | ConvertTo-SecureString
  
  ConvertTo-SecureString : Key not valid for use in specified state.
  At E:\temp\get_user_cliffsv4.ps1:5 char:24
  + $securePwd = $pwdTxt | ConvertTo-SecureString
  +                        ~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : InvalidArgument: (:) [ConvertTo-SecureString], 
  CryptographicException
  + FullyQualifiedErrorId : 
  ImportSecureString_InvalidArgument_CryptographicError,Microsoft.PowerShell. 
  Commands.ConvertToSecureStringCommand
  </code></pre>
  
  <p>I have run this script numerous times through automation software, but when testing I had to run the command as my personal account because of this error and to get around this so I could complete testing, I invoked that option. My question is, is the account I'm using missing any particular rights? Do I have to install the Powershell extensions under that account or can I set/change something in PS or on the server that will allow the service account to run this script? Thanks in advance!</p>