Exception setting ApplicationPoolPassword
-
16-10-2019 - |
Question
Following the example in this blog post, I am trying to create a new Web Application with PowerShell.
However, when I try the line:
$WebAppBuilder.ApplicationPoolPassword = "password"
I receive the following error:
Exception setting "ApplicationPoolPassword": "Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString"."
How might I go about fixing this?
Solution
You will have to ConvertTo-SecureString as documented here.
Or you could use Get-Credential to retrieve password, e.g. something like this:
$credential = Get-Credential
$credential.GetNetworkCredential().Password
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange