Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
PowerShell Script To Get System Account Of A Web Application
WhatsApp
Abhay Shanker
11y
6.1
k
0
0
25
Blog
The mentioned below script explains how to get the System Account of a Web Application in the SharePoint using a PowerShell script.
$
farmWebAppService
= (Get-SPFarm).Services | ? { $_.typename -eq "Microsoft SharePoint Foundation Web Application" }
foreach($webApp in $farmWebAppService.WebApplications)
{
Write-Host "Web Application: " $webApp.Name
$
collection
= @()
foreach ($zonepol in $webApp.Policies)
{
if($zonepol.IsSystemUser -eq $true)
{
$collection += $zonepol;
}
}
if($collection.Count -eq 0)
{
Write-Host "System Account (application pool account): " $webApp.ApplicationPool.DisplayName " - " $webApp.ApplicationPool.Username
}
else
{
foreach($item in $collection)
{
Write-Host "System Account (policy setting): " $item.DisplayName " - " $item.UserName
}
}
}
PowerShell script to get System Account of a Web Application
Up Next
Get the user profile property information by account name using SharePoint 2010 web service in powershell
Ebook Download
View all
Getting Started with SharePoint Framework Development using TypeScript, PnP JS, and React JS
Read by 4.9k people
Download Now!
Learn
View all
Membership not found