New-SPWebApplication application pool account not found

I am trying to create a new web application using PowerShell. I keep getting the application pool account error not found! How to solve this?

I tried adding a new web application to DefaultAppPool as follows:

New-SPWebApplication -Name "Test WebApp" -ApplicationPool "DefaultAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "WIN2K8R2SPTEST\Administrator")

But the Cmdlet Get-SPManagedAccount seems to return an empty string. I also tried changing ApplicationPool to SharePoint 80.

I am running SharePoint Foundation 2010 on a standalone installation. How can I fix this error?

+5
source share
1 answer

First you must create a managed account for your win2k8r2sptest \ administrator. Here is the sequence of steps

$cred = get-credential 'win2k8r2sptest\administrator' // enter the password here
$adminMA = New-SPManagedAccount -Credential $cred
New-SPWebApplication -Name 'Test Webapp' -ApplicationPool "DefaultAppPool" -ApplicationPoolAccount $adminMA

SPS2010 SP1. , Foundation.

+7

All Articles