SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted

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 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.