Recently I was trying to create a web application using PowerShell in SharePoint 2016. The error comes as New-SPWebApplication ApplicationPoolAccount is not found. You can write, execute, and debug the PowerShell script using Windows PowerShell ISE.
I was using the below PowerShell script:
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$authentication = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos
New-SPWebApplication -Name "SharePoint 2016 Web App" -Port 80 -ApplicationPool "Sharepoint2016" -ApplicationPoolAccount (Get-SPManagedAccount "mama") -AuthenticationMethod NTLM -AuthenticationProvider $authentication
And the error will come like below:
New-SPWebApplication ApplicationPoolAccount is not found
New-SPWebApplication ApplicationPoolAccount is not found
Here two things I have changed, one is we need to provide a domain account instead of the only username. I was using the account name as “mama”, so I modified to “domain name\user name” like “TSINFO\mama”.
The other point we need to check is that there should not be any line break in the New-SPWebApplication cmdlets. I have modified the cmdlet to like below and it successfully created the web application.
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$authentication = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos
New-SPWebApplication -Name "SharePoint 2016 Web App" -Port 80 -ApplicationPool "Sharepoint2016" -ApplicationPoolAccount (Get-SPManagedAccount "TSINFO\mama") -AuthenticationMethod NTLM -AuthenticationProvider $authentication
Read some PowerShell tutorials:
- Delete list items created before N days using PowerShell in SharePoint Online
- Retrieve List Items Created in Last N days using PowerShell SharePoint Online
- SharePoint Online Create Workflow History List using PowerShell or using SharePoint Designer 2013
- Delete Hidden Web Application in SharePoint 2013 using PowerShell
- GridView in PowerShell in SharePoint
- [Solved] the term ‘connect-msolservice’ is not recognized as the name of a cmdlet function
I hope this tutorial helps to fix error New-SPWebApplication ApplicationPoolAccount is not found.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”