mercredi 18 février 2015

IIS app pool identity is entered incorrectly from powershell script


Vote count:

0




I'm writing a powershell script to install my application and configure the web application identity for a specific user.


The code i'm using is:



$pool.processModel.identityType = 3
$AppPoolUsername = Read-Host "User name(domain\username)"
$AppPoolPassword = Read-Host "Password" -AsSecureString
$pool.processModel.userName = [string]$AppPoolUsername`enter code here`
$pool.processModel.password = [string]$AppPoolPassword


After I ran the script I ran the application and the App Pool is stopped. If i will manually enter the app pool identity it will not stopped and the web application will work.


I tried to convert the password from a securestring to a regular string with no success with this code:



$AppPoolPassword = Read-Host -Prompt "Password" -AsSecureString
$pool.processModel.userName = [string]$AppPoolUsername
$pool.processModel.password = ConvertFrom-SecureString -SecureString $AppPoolPassword


I get "01000000d08c9ddf0115d1118c7a00c04fc297eb010000006876492ae8edf3429d809bb3ca213d910000000002000000000003660000c000000010000000ebd2f4fc7a59a92ad8cb2c4 9b99498fc0000000004800000a0000000100000007ffdc206c4eeb7c67237d24e575f86ff08000000fe8c91a31879d93014000000fee1ff6c8aa4fe66e9debe245e7ea3fd26fc823a" when checking the app pool password.


Is that right or should i get the regular string i input?


Am I at the right direction?



asked 1 min ago







IIS app pool identity is entered incorrectly from powershell script

Aucun commentaire:

Enregistrer un commentaire