Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

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 
$credential.GetNetworkCredential().Password
share|improve this answer
add comment

Your Answer

 
discard

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.