Jason is correct. Per MSDN:
If an encryption key is specified by using the Key or SecureKey parameters, the Advanced Encryption Standard (AES) encryption algorithm is used. The specified key must have a length of 128, 192, or 256 bits because those are the key lengths supported by the AES encryption algorithm. If no key is specified, the Windows Data Protection API (DPAPI) is used to encrypt the standard string representation.
In order to do what you are looking to do, you must convert the password to the encrypted string using AES (i.e. add the -Key or -SecureKey parameter when using ConvertFrom-SecureString) then provide that same key when decoding.
Alternatively, you could leverage BigFix Secure Parameters to provide the password and not have worry about the encryption yourself. If your not familiar with how to do this, put this code snip into the description of your task:
<input id="password" type="password" name="password">
<script>
document.body.ontakeaction = function() {
var password = document.getElementById( "password" ).value;
TakeSecureFixletAction( Relevance('id of current fixlet'), Relevance('id of current bes site'), "Action1", {}, { password: password } );
return false;
}
</script>
and then you can access the decrypted password within your actionscript with:
net user Administrator {parameter "password" of action}
@brolly33 did a great overview of Secure Parameters over on the BigFix Tech Advisors YouTube Channel