Share via


SharePoint for Farm/WebApp: Powershell One Liners

1. Get the host named Site collections in SharePoint

Get-SPSite -limit all|?{$_.HostHeaderIsSiteName -eq $true} | Out-GridView

2. Get Alternate Urls

(Get-SpWEbApplication).AlternateUrls

3.Get Users for a WEb[Rename the url]

(Get-SPWEb -identity "http://hrweb.contoso.com").AllUsers

4. Get the Author for a WEb

(Get-SPWEb -identity "http://hrweb.contoso.com").Author

5. When was this web created?

(Get-SPWEb -identity "http://hrweb.contoso.com").Created

6. List all properties of Farm

Get-SPFarm | select -Property *

7. List the Name and disksize for first 2 SharePoint Content database sorted by disksize

Get-SpContentDatabase | sort disksizerequired| select Name,DiskSizeRequired -First 5

8. Get the GUID of your web

(Get-SPSite -identity "http://intranet.contoso.com/sites/contoso").ID

9. Count of all server in SharePoint Farm

Get-SPServer | measure

10. View performance counter settings for WEb Front End

Get-SpDiagnosticsPerformanceCounter  -WebFrontEnd

11.#View all performance counter

Get-SPWebApplicationHttpThrottlingMonitor -Identity "http://intranet.contoso.com"

#View User Policies

(Get-SPWebApplication).Policies

#WEb Application Properties

$spWEbApp = Get-SPWebApplication -Identity "http://w15-sp"

#WEb Application property

$spWEbApp.AlertFlags

$spWEbApp.AlertsEnabled

$spWEbApp.AlertsEventBatchSize

$spWebApp.AlertsLimited

$spWEbApp.AlertsMaximum

$spWEbApp.AlertsMaximumQuerySet

$spWEbApp.AllowAccessToWebPartCatalog

$spWEbApp.AllowAnalyticsCookieForAnonymousUsers

$spWEbApp.AllowContributorsToEditScriptableParts

$spWEbApp.AllowDesigner

#View allowed downlaods

$spwebApp.AllowedInlineDownloadedMimeTypes

$spwebApp.AllowHighCharacterListFolderNames

#Is MAster PAge editing allowed

$spwebApp.AllowMasterPageEditing

#AllowOMCodeOverrideThrottleSettings

$spwebApp.AllowOMCodeOverrideThrottleSettings

#AllowPartToPartCommunication

$spwebApp.AllowPartToPartCommunication

#AllowRevertFromTemplate

$spwebApp.AllowRevertFromTemplate

#AllowSelfServiceUpgradeEvaluation

$spwebApp.AllowSelfServiceUpgradeEvaluation

#AllowSilverlightPrompt

$spwebApp.AllowSilverlightPrompt

#AlternateUrls

$spwebApp.AlternateUrls

#AlwaysProcessDocuments

$spWebApp.AlwaysProcessDocuments

$spwebApp.ApplicationPool

#View Rights

$spwebApp.ApplicationPrincipalMaxRights

#AppResourceTrackingSettings

$spwebApp.AppResourceTrackingSettings

#AutomaticallyDeleteUnusedSiteCollections

$spwebApp.AutomaticallyDeleteUnusedSiteCollections

#BlockedFileExtensions

$spwebApp.BlockedFileExtensions

#BrowserCEIPEnabled

$spwebApp.BrowserCEIPEnabled

#BrowserFileHandling

$spwebApp.BrowserFileHandling

#CanMigrate

$spwebApp.CanMigrate

#CanRenameOnRestore

$spwebApp.CanRenameOnRestore

#CanSelectForRestore

$spwebApp.CanSelectForRestore

#Can web application be upgraded

$spWebApp.CanUpgrade

#CascadeDeleteMaximumItemLimit

$spWebApp.CascadeDeleteMaximumItemLimit

#CascadeDeleteTimeoutMultiplier

$spWEbApp.CascadeDeleteTimeoutMultiplier

#ClientCallableSettings

$spWebApp.ClientCallableSettings

#Max Resources per request

($spWebApp.ClientCallableSettings).MaxResourcesPerRequest

#CellStorageDataCleanupExcludedDocTypes

$spWebApp.CellStorageDataCleanupExcludedDocTypes

#CellStorageUserDataDeleteIncludedDocTypes

$spWebApp.CellStorageUserDataDeleteIncludedDocTypes

#CellStorageUserDataDeleteSizeThreshold

$spWebApp.CellStorageUserDataDeleteSizeThreshold

#Cell Storage web service

$spWebApp.CellStorageWebServiceEnabled

#Is Log Expiration Enabled

$spWebApp.ChangeLogExpirationEnabled

#Days to retain logs

$spWebApp.ChangeLogRetentionPeriod

($spWebApp.ChangeLogRetentionPeriod).Days

#ClientCallableSettings

$spWebApp.ClientCallableSettings

#CompatibilityRange

$spWebApp.CompatibilityRange

#Content Databases

$spWebApp.ContentDatabases

#CrossDomainPhotosEnabled

$spWebApp.CrossDomainPhotosEnabled

#CustomAppErrLimit

$spWebApp.CustomAppErrorLimit

#DailyStartUnthrottledPrivilegedOperations Time

$spWebApp.DailyStartUnthrottledPrivilegedOperationsHour

$spWebApp.DailyStartUnthrottledPrivilegedOperationsMinute

$spWebApp.DailyUnthrottledPrivilegedOperationsDuration

#DataRetrievalProvider

$spWebApp.DataRetrievalProvider

#DaysToShowNewIndicator

$spWebApp.DaysToShowNewIndicator

$spWebApp.DefaultQuotaTemplate

$spWebApp.DefaultServerComment

$spWebApp.DefaultTimeZone

$spWebApp.DisableCoauthoring

$spWEbApp.DiskSizeRequired

$spWEbApp.DisplayName

$spWEbApp.DocumentConversionsEnabled

$spWEbApp.DocumentConversionsLoadBalancerServerId

$spWEbApp.DocumentConversionsLoadBalancerUrl

$spWEbApp.DocumentConversionsSchedule

#To WEb Page

$spWebApp.DocumentConverters|select Name

#DocumentLibraryCalloutOfficeWebAppPreviewersDisabled

$spWebApp.DocumentLibraryCalloutOfficeWebAppPreviewersDisabled

#EmailToNoPermissionWorkflowParticipantsEnabled

$spWebApp.EmailToNoPermissionWorkflowParticipantsEnabled

#EnabledClaimProviders

$spWebApp.EnabledClaimProviders

#EventHandlersEnabled

$spWebApp.EventHandlersEnabled

#EventLogRetentionPeriod

$spWebApp.EventLogRetentionPeriod

#ExternalUrlZone

$spWebApp.ExternalUrlZone

#ExternalWorkflowParticipantsEnabled

$spWebApp.ExternalWorkflowParticipantsEnabled

#Farm

$spWebApp.Farm

#Featires

$spWebApp.Features

#Farm Status,Name

$spWEbApp.Farm

#View 15 features

$spWEbApp.Features | ?{$_.Version -like "*15*"}

#Count of Features

$spWEbApp.Features.Count

#Features sort by timeActivated

$spWEbApp.Features | select DefinitionId,Definition,TimeActivated|sort TimeActivated -Descending

#Group by scope

$spWEbApp.Features | select * | group FeatureDefinitionScope

#FileNotFoundPage

$spWEbApp.FileNotFoundPage

#ForceseekEnabled

$spWEbApp.ForceseekEnabled

#FormDigestSettings

$spWebApp.FormDigestSettings

#Job Definitions

$spWEbApp.JobDefinitions

#JobHistoryEntries

$spWEbApp.JobHistoryEntries

#View Succeeded JObs

$spWEbApp.JobHistoryEntries|?{$_.Status -like "*Succeeded*"}

#View ErrorMessage

$spWEbApp.JobHistoryEntries|?{$_.ErrorMessage -ne ""}

$spWEbApp.RunningJobs

$spWEbApp.MasterPageReferenceEnabled

#MaximumFileSize

$spWEbApp.MaximumFileSize

#MaximumFileSizePerExtension

$spWEbApp.MaximumFileSizePerExtension

#MaxItemsPerThrottledOperation

$spWEbApp.MaxItemsPerThrottledOperation

#MaxItemsPerThrottledOperationOverride

$spWEbApp.MaxItemsPerThrottledOperationOverride

#MaxItemsPerThrottledOperationWarningLevel

$spWEbApp.MaxItemsPerThrottledOperationWarningLevel

#MaxListItemRowStorage

$spWEbApp.MaxListItemRowStorage

#MaxQueryLookupFields

$spWEbApp.MaxQueryLookupFields

#MaxSizeForSelfServiceEvalSiteCreationMB

$spWEbApp.MaxSizeForSelfServiceEvalSiteCreationMB

#MaxSizePerCellStorageOperation

$spWEbApp.MaxSizePerCellStorageOperation

#MaxUniquePermScopesPerList

$spWEbApp.MaxUniquePermScopesPerList

#MetaWeblogAuthenticationEnabled

$spWEbApp.MetaWeblogAuthenticationEnabled

#MetaWeblogEnabled

$spWEbApp.MetaWeblogEnabled

#MimeMappings

$spWEbApp.MimeMappings

$spWEbApp.Name

#NeedsUpgrade

$spWEbApp.NeedsUpgrade

#NeedsUpgradeIncludeChildren

$spWEbApp.NeedsUpgradeIncludeChildren

#OfficialFileName

$spWEbApp.OfficialFileName

#OfficialFileHosts

$spWEbApp.OfficialFileHosts

#OfficialFileUrl

$spWEbApp.OfficialFileUrl

#OutboundMailCodePage

$spWEbApp.OutboundMailCodePage

#OutboundMailReplyToAddress

$spWEbApp.OutboundMailReplyToAddress

#OutboundMailSenderAddress

$spWEbApp.OutboundMailSenderAddress

#OutboundMailServiceInstance

$spWEbApp.OutboundMailServiceInstance

#OutboundMmsServiceAccount

$spWEbApp.OutboundMmsServiceAccount

#OutboundSmsServiceAccount

$spWEbApp.OutboundSmsServiceAccount

$spWEbApp.PeoplePickerSettings

#PeoplePickerSettings

$spWEbApp.PeoplePickerSettings

#Parent

$spWEbApp.Parent

#Policies

$spWEbApp.Policies|select DisplayName

#POlicy Roles

$spWEbApp.PolicyRoles

#Prefix

$spWEbApp.Prefixes

#Presence Enabled

$spWEbApp.PresenceEnabled

#Properties

$spWEbApp.Properties

#PublicFolderRootURl

$spWEbApp.PublicFolderRootUrl

$spWEbApp.RecycleBinCleanupEnabled

#RecycleBinRetentionPeriod

$spWEbApp.RecycleBinRetentionPeriod

$spWEbApp.RenderingFromMetainfoEnabled

#Request Management Settings

$spWEbApp.RequestManagementSettings

($spWEbApp.RequestManagementSettings).Name

($spWEbApp.RequestManagementSettings).Id

($spWEbApp.RequestManagementSettings).Farm

($spWEbApp.RequestManagementSettings).IsInitialized

($spWEbApp.RequestManagementSettings).MachinePools

($spWEbApp.RequestManagementSettings).MaxRequestBufferCount

($spWEbApp.RequestManagementSettings).MinimumCacheRefreshTime

($spWEbApp.RequestManagementSettings).Parent

($spWEbApp.RequestManagementSettings).PingAvailabilityThreshold

($spWEbApp.RequestManagementSettings).PingFailureLimit

($spWEbApp.RequestManagementSettings).PingInterval

(($spWEbApp.RequestManagementSettings).PingInterval).Days

(($spWEbApp.RequestManagementSettings).PingInterval).Hours

(($spWEbApp.RequestManagementSettings).PingInterval).Milliseconds

(($spWEbApp.RequestManagementSettings).PingInterval).Minutes

(($spWEbApp.RequestManagementSettings).PingInterval).Seconds

(($spWEbApp.RequestManagementSettings).PingInterval).Ticks

(($spWEbApp.RequestManagementSettings).PingInterval).TotalDays

(($spWEbApp.RequestManagementSettings).PingInterval).TotalHours

(($spWEbApp.RequestManagementSettings).PingInterval).TotalMilliseconds

(($spWEbApp.RequestManagementSettings).PingInterval).TotalMinutes

(($spWEbApp.RequestManagementSettings).PingInterval).TotalSeconds

($spWEbApp.RequestManagementSettings).PingPassLimit

($spWEbApp.RequestManagementSettings).Properties

($spWEbApp.RequestManagementSettings).RequestBufferLength

($spWEbApp.RequestManagementSettings).RequestExecutionTimeout

($spWEbApp.RequestManagementSettings).RoutingEnabled

($spWEbApp.RequestManagementSettings).RoutingHealthScoreDepreciationTime

($spWEbApp.RequestManagementSettings).RoutingRules

($spWEbApp.RequestManagementSettings).RoutingScheme

($spWEbApp.RequestManagementSettings).RoutingTargets

($spWEbApp.RequestManagementSettings).ThrottlingEnabled

($spWEbApp.RequestManagementSettings).ThrottlingRules

($spWEbApp.RequestManagementSettings).TypeName

($spWEbApp.RequestManagementSettings).UpgradedPersistedProperties

$spWebApp.RequireContactForSelfServiceSiteCreation

$spWebApp.RightsMask

$spWebApp.RunningJobs

$spWebApp.ScopeExternalConnectionsToSiteSubscriptions

#SecondStageRecycleBinQuota

$spWebApp.SecondStageRecycleBinQuota

$spWebApp.SelfServiceCreateIndividualSite

$spWebApp.SelfServiceCreationParentSiteUrl

$spWebApp.SelfServiceCreationQuotaTemplate

$spWebApp.SelfServiceSiteCreationEnabled

$spWebApp.SelfServiceSiteCustomFormUrl

$spWebApp.SendLoginCredentialsByEmail

$spWebApp.SendSiteUpgradeEmails

$spWebApp.SendUnusedSiteCollectionNotifications

$spWebApp.ServiceApplicationProxyGroup

$spWebApp.ShowStartASiteMenuItem

$spWebApp.ShowURLStructure

$spWebApp.SiteDataServers

#View all Sites

$spWebApp.Sites

$spWebApp.SiteSubscriptions

$spWebApp.SiteUpgradeThrottleSettings

($spWebApp.SiteUpgradeThrottleSettings).AppPoolConcurrentUpgradeSessionLimit

($spWebApp.SiteUpgradeThrottleSettings).DisplayName

($spWebApp.SiteUpgradeThrottleSettings).Farm

($spWebApp.SiteUpgradeThrottleSettings).Id

($spWebApp.SiteUpgradeThrottleSettings).Name

($spWebApp.SiteUpgradeThrottleSettings).Parent

($spWebApp.SiteUpgradeThrottleSettings).Properties

($spWebApp.SiteUpgradeThrottleSettings).Status

($spWebApp.SiteUpgradeThrottleSettings).SubwebCountLimit

($spWebApp.SiteUpgradeThrottleSettings).TypeName

($spWebApp.SiteUpgradeThrottleSettings).UpgradedPersistedProperties

($spWebApp.SiteUpgradeThrottleSettings).UsageStorageLimit

($spWebApp.SiteUpgradeThrottleSettings).Version

$spWebApp.StorageMetricsProcessingDuration

$spWebApp.Status

$spWebApp.SuiteBarBrandingElementHtml

$spWebApp.SyndicationEnabled

$spWebApp.UnusedSiteNotificationPeriod

$spWebApp.UnthrottledPrivilegedOperationWindowEnabled

$spWebApp.UnusedSiteNotificationsBeforeDeletion

$spWebApp.UpgradeContext

$spWebApp.UpgradedPersistedProperties

$spWebApp.UpgradeEvalSitesRetentionDays

$spWebApp.UpgradeMaintenanceLink

$spWebApp.UpgradeReminderDelay

#IS Claims Authentication used

$spWebApp.UseClaimsAuthentication

$spWebApp.UseExternalUrlZoneForAlerts

#Workflow Complexity

$spWebApp.UserDefinedWorkflowMaximumComplexity

$spWebApp.UserDefinedWorkflowsEnabled

$spWebApp.UserPhotoErrorExpiration

$spWebApp.UserPhotoExpiration

$spWebApp.UserPhotoImportEnabled

$spWebApp.UserPhotoOnlineImportEnabled

#User Resource Tracking Settings

$spWebApp.UserResourceTrackingSettings

#User Profile Settings

$spWebApp.UserSettingsProvider

$spWebApp.UserSettingsProvider|select Name

#Url

$spWebApp.Url

$spWebApp.Version

#WEb Config Modifications

$spWebApp.WebConfigModifications

($spWebApp.WebConfigModifications).Count

$spWebApp.WebConfigModifications|select Name

$spWebApp.WebConfigModifications|select Owner

$spWebApp.WebConfigModifications|select Path

$spWebApp.WebConfigModifications|select Value

$spWebApp.WebConfigModifications|select Type

#View all web extensions

$spWebApp.WebFileExtensions

#Web Service

$spWebApp.WebService

($spWebApp.WebService).ActiveDirectoryDomain

($spWebApp.WebService).ActiveDirectoryOrganizationalUnit

($spWebApp.WebService).AllowAggregationCalendar

($spWebApp.WebService).AlternateContentEditorScript

($spWebApp.WebService).AntivirusSettings

($spWebApp.WebService).ApplicationPools

($spWebApp.WebService).ApplicationPools|select Name

($spWebApp.WebService).Applications

#Background File Limits

($spWebApp.WebService).BackgroundFileSyncThrottlingSettings

($spWebApp.WebService).BrowserCEIPEnabled

($spWebApp.WebService).CacheSiteLookup

($spWebApp.WebService).CanBackupRestoreAsConfiguration

($spWebApp.WebService).CanRenameOnRestore

($spWebApp.WebService).CanSelectForBackup

($spWebApp.WebService).CanSelectForRestore

($spWebApp.WebService).CanUpgrade

($spWebApp.WebService).CdnPrefix

($spWebApp.WebService).ClientRequestServiceSettings

($spWebApp.WebService).CoauthoringMaxAuthors

($spWebApp.WebService).CoauthoringVersionPeriod

($spWebApp.WebService).CollectSPRequestAllocationCallStacks

($spWebApp.WebService).CorporateCuratedGalleryAppQueryInterval

($spWebApp.WebService).CreateActiveDirectoryAccounts

Get-SPWebApplicationHttpThrottlingMonitor -Identity "http://w15-sp"

Get-SPWebPartPack

Get-SPWebTemplate

Get-SPWOPIBinding

Get-SPWOPISuppressionSetting

Get-SPWOPIZone

Get-SPWorkflowConfig -WebApplication http://w15-sp

Get-SPWorkflowServiceApplicationProxy

#View Template name for a site collection

Get-SPWeb -Identity "http://w15-sp" | select WEbTemplate

Get-SPWebTemplate | select NAme > c:\demo\templates.txt