How to specify application pool identity user and password from PowerShell
You would do this as follows:
Import-Module WebAdministrationSet-ItemProperty IIS:\AppPools\app-pool-name -name processModel -value @{userName="user_name";password="password";identitytype=3}
See this document here for an explanation, and a reference of the indentity type numeric for the user type you will run the app pool under: http://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel
After few experiments
Here is my Answer, I hope this will helps , I've worked on IIS 8.5
$credentials = (Get-Credential -Message "Please enter the Login credentials including Domain Name").GetNetworkCredential()$userName = $credentials.Domain + '\' + $credentials.UserNameSet-ItemProperty IIS:\AppPools\$app_pool_name -name processModel.identityType -Value SpecificUser Set-ItemProperty IIS:\AppPools\$app_pool_name -name processModel.userName -Value $usernameSet-ItemProperty IIS:\AppPools\$app_pool_name -name processModel.password -Value $credentials.Password
seems you can do this a little more directly now
appcmd set apppool junkapp /processmodel.password:junkpassword