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

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

I tried adding the 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 to change the ApplicationPool to SharePoint 80.

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

share|improve this question
add comment

2 Answers

Try this

New-SPWebApplication -Name "Test WebApp" -Port 80 -URL "http://testwebapp" -ApplicationPool "TestWebAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "WIN2K8R2SPTEST\Administrator")

This will create a new web application with a new application pool account which sharepoint will register itself and map it to the port 80. You wont need to modify any settings in IIS for this.

Just ensure your port 80 is free and there are no previous SharePoint or IIS site is mapped to it.

share|improve this answer
    
I already have a share point web application running on port 80. Initially, i tried with a port number specified.. but after reading the docs I found that port is optional and a random port is assigned when creating the new web application. –  Abdel Olakara Jun 6 '12 at 8:20
    
Its is rather advised that you specify a port number larger than 3000 and create a web application on that port. –  Arko D Jun 6 '12 at 10:01
add comment
up vote 0 down vote accepted

For those who need the solution: Refer to the answer from Stackoverflow for the same question. First I needed to create a managed account since I didn't have one. And then use the New-SPWebApplication cmdlet to create a new webapplication.

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.