How to disable "Microsoft SharePoint Foundation Web Application" on App servers using powershell?

Hemant Risbud 1 Reputation point
2021-01-25T18:58:31.467+00:00

I configured SharePoint 2019 On premise farm with following server roles. "Microsoft SharePoint Foundation Web Application" runs on all servers.
2 - WFE servers with MinRole
2 - Search servers with Application with Search MinRole
2 - App servers with Application MinRole

Do I need to change MinRoles to "Custom" on App and Search servers? How can I change MinRole to "Custom" without impacting what is configured on these App and Search servers?

How do I limit "Microsoft SharePoint Foundation Web Application" run on WFE servers only using PowerShell?

This command will give me details on where "Microsoft SharePoint Foundation Web Application" running in farm
Get-SPServiceInstance | where {$_.TypeName -like "Foundation Web"} | select ID, Name, Server, Status

$svc = Get-SPServiceInstance | where {$_.ID -like "GUID from earlier step"}
$svc.Status = "Offline"
$svc.Update()
or
Stop-SPServiceInstance $svc

or

$ServiceName = "Microsoft SharePoint Foundation Web Application"
Get-SPServiceInstance -server $env:COMPUTERNAME | where-object {$_.TypeName -eq $ServiceName} | Stop-SPServiceInstance -confirm:$false > $null

Do I need to remnants of SharePoint sites in IIS Manager after removing "Microsoft SharePoint Foundation Web Application" service?

Microsoft 365 and Office SharePoint Server For business
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. trevorseward 11,711 Reputation points
    2021-01-25T19:34:19.993+00:00

    Why do you want to do that? Leave them enabled and then use a hosts file on the Search servers to target the search crawl at the App Server(s).

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.