iiswebdeploy

MSDeploy on IIS corrupting apppool password


I'm trying to use msdeploy to transfer sites from one server to another. I was working fine until lately where is corrupts the password of the application pool.
command: msdeploy -verb:sync -source:apppoolconfig -dest:apppoolconfig,computername=compname

Verified in the applicationhost.config file and the apppool looks something like this on the main IIS server:

<processModel identityType="SpecificUser" userName="domainuser" password="[enc:IISWASOnlyCngProvider:3eoKKcj4586uAOnMHYR68JT+jdhf83JCLWmLn80XH6jyF2oKCmd5541FBm/A6zMSVUTNcS3Ax2CMP9ootcz3WUTfHmg7Gq3VmBjHCHZ0OJcAmemmxMUByhztxNIiggJuc:enc]" />

Was the same type on the target server but now since a few days it is completely different and I have to reenter the password on the apppool. Password looks like this:

<processModel identityType="SpecificUser" userName="domainuser" password="[enc:IISWASOnlyCngProvider:AH535zeQZd1/KYCADJc84lqFhilcb55Kfub/YDhH4FK+xlFdDxBdz1HkJ5R34gShTK4JXhD4qz11YN8kzAQcYG38Mntjrh2liNvhwT+IKUaiwgZ2rjADJc84ltye0KugDj6D41voWjLbVTMCpOTSzCsADJc84lBIkRHWphxPYJS2hCnDJIC8+4fnHfSq8IZAbzJCkzsixSCiZC0OfdhFZz1Ri2ndJJKz012UwNDLTA5jJAD/eFbVTXm2NLI4F17tXI6WZLheMDhTmVlQi5SdBADJc84l0npqN7U8wO45IuwvfHIwtvOKBhqzKZckPL2v6L/Y0ksISHy9PamcPw5JxvnY4G9UmPY2GW6gYoHAhYIiWU04IZEsm6afSYwIE+zIe0DeXA/tgHb+tvnE0wlB6k2zHm/oZZoEMMt2NEm7Z5GbF5rQcY02qm7fyX8OsxgEoJIUo2PamcPw5JADJc84lzbP96iR2QzF/5I6FYSdZhap6XZbyRgyhfsXxWv3rqWY:enc]" />

As if it wasn't using the right encryption or something. If I reenter the password on the apppool everything works fine

Tried doing a backup and restore with msdeploy instead of direct sync and it did the same thing. Only thing that changed on the server before it started happening was to add an extra apppool. Removing it didn't solve the issue.

Any ideas on what I could look into?

thanks


Solution

  • Finally found it. Been going through everything an no logs nothing anywhere that would give me a hint.

    Figured out that, even if I'm domain admin, if powershell is not opened as "run as admin" it screws up all the passwords for the apppools and virtual directory in the IIS (even if everything else works). would have been nice to have a proper warning somewhere ;)