Getting your SharePoint Farm Information :
here you can run the powershell command to get the total sharepoint farm information into .csv file.
#Get Backup Path
$bkdir = read-host("Enter Folder Location") # Get Backup Path!
# Set Backup Path if you want to hard code your path
#$bkdir = "\\serverName\Shared\Temp" (optional "C:\Temp")
# Verify folder exists
if ((test-path $bkdir) -eq $false ) # Verify folder else create it...
{
[IO.Directory]::CreateDirectory($bkdir)
}
# Add Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0
#Get Web Application Data
Write-Host("Getting Web Application Data")
Get-SPWebApplication -IncludeCentralAdministration | select Name, DisplayName, Id, Url, ApplicationPool, @{Expression={$_.ApplicationPool.Name}}, @{Expression={$_.ApplicationPool.UserName}}, DefaultQuotaTemplate | Export-CSV $bkdir\SPWebApplication.csv
#Get Site Collection Data
Write-Host("Getting Site Collection Data")
Get-SPSite -Limit All | select Id, HostName, Url, Owner,WebApplication, ContentDatabase, RootWeb, LastContentModifiedDate, @{Expression={$_.Usage.Storage}} | Export-CSV $bkdir\SPSite.csv
#Get Site Data
Write-Host("Getting Site Data")
Get-SPSite -Limit All | Get-SPWeb -Limit All | select ID, Title, Author, Url, WebTemplate, LastItemModifiedDate, IsRootWeb | Export-CSV $bkdir\SPWeb.csv
#Get Site Admin Data
Write-Host("Getting Site Administration Data")
Get-SPSiteAdministration -Limit All | Select Url, Title,OwnerLoginName, SecondaryContactLoginName, UsersCount, RootWebTemplate | Export-CSV $bkdir\SPSiteAdmin.csv
#Get SandBox Solutions
Write-Host("Getting SandBox Solutions")
Get-SPSite -Limit All | Get-SPUserSolution | select Name, SolutionId, Status, HasAssemblies | Export-CSV $bkdir\SPUserSolution.csv
#Get Process Accounts
Write-Host("Getting Process Accounts")
Get-SPProcessAccount | select Name, SecurityIdentifier | Export-CSV $bkdir\SPProcesAcct.csv
#Get Managed Accounts
Write-Host("Getting Managed Accounts")
Get-SPManagedAccount | select TypeName, UserName, DiplayName, Sid, AutomaticChange, Name, Id, Status | Export-CSV $bkdir\SPManagedAccts.csv
#Get Alternate URLs
Write-Host("Getting Alternate URLs")
Get-SPAlternateUrl | select IncomingUrl, UrlZone, PublicUrl | Export-CSV $bkdir\SPAlternateUrl.csv
#Get Managed Paths
Write-Host("Getting Managed Paths")
Get-SPWebApplication | Get-SPManagedPath | Export-CSV $bkdir\SPManagedPath.csv
#Get Solutions
Write-Host("Getting Farm Solutions")
Get-SPSolution | select SolutionId, Name, DisplayName, Deployed, DeploymentState, SolutionFile, ContainsGlobalAssembly, ContainsWebApplicationResource, JobExists, Version | Export-CSV $bkdir\SPSolution.csv
#Get Features
Write-Host("Getting Features")
Get-SPFeature | select SolutionId, Name, DisplayName, Scope, RootDirectory, Status | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id | Export-CSV $bkdir\SPFeature.csv
#Get SP Databases
Write-Host("Getting SP Databases")
Get-SPDatabase | select DisplayName, Server, ID, Status | Export-CSV $bkdir\SPDatabase.csv
#Get Content Databases
Write-Host("Getting Content Databases")
Get-SPContentDatabase | select Name, DisplayName, Id, Server, PreferredTimerServiceInstance, CurrentSiteCount, WarningSiteCount, MaximumSiteCount, WebApplication, Exists, IsReadOnly, DiskSizeRequired, NeedsUpgradeIncludeChildren, NeedsUpgrade, Status, Version | Export-CSV $bkdir\SPContentDatabase.csv
#Get Services
Write-Host("Getting Service Intances")
Get-SPServiceInstance | select TypeName, Service, Id, Server, NeedsUpgradeIncludeChildren, NeedsUpgrade, Status, Version | Export-CSV $bkdir\SPServiceIntances.csv
#Get Service Applications
Write-Host("Getting Service Applications")
Get-SPServiceApplication | select Name, DisplayName, TypeName, Id, IisVirtualDirectoryPath, ApplicationPool, Service, DefaultEndpoint, Version | Export-CSV $bkdir\SPServiceApplication.csv
#Get Web Templates
Write-Host("Getting Web Templates")
Get-SPWebTemplate | select ID, Title, Name, Description, Lcid, IsCustomTemplate, IsRootWebOnly, IsSubWebOnly | Export-CSV $bkdir\SPWebTemplate.csv
#Get Service Application Pools
Write-Host("Getting Service Application Pool Accounts")
Get-SPServiceApplicationPool | select Id, Name, ProcessAccountName | Export-CSV $bkdir\SPAppPoolAccounts.csv
here you can run the powershell command to get the total sharepoint farm information into .csv file.
#Get Backup Path
$bkdir = read-host("Enter Folder Location") # Get Backup Path!
# Set Backup Path if you want to hard code your path
#$bkdir = "\\serverName\Shared\Temp" (optional "C:\Temp")
# Verify folder exists
if ((test-path $bkdir) -eq $false ) # Verify folder else create it...
{
[IO.Directory]::CreateDirectory($bkdir)
}
# Add Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0
#Get Web Application Data
Write-Host("Getting Web Application Data")
Get-SPWebApplication -IncludeCentralAdministration | select Name, DisplayName, Id, Url, ApplicationPool, @{Expression={$_.ApplicationPool.Name}}, @{Expression={$_.ApplicationPool.UserName}}, DefaultQuotaTemplate | Export-CSV $bkdir\SPWebApplication.csv
#Get Site Collection Data
Write-Host("Getting Site Collection Data")
Get-SPSite -Limit All | select Id, HostName, Url, Owner,WebApplication, ContentDatabase, RootWeb, LastContentModifiedDate, @{Expression={$_.Usage.Storage}} | Export-CSV $bkdir\SPSite.csv
#Get Site Data
Write-Host("Getting Site Data")
Get-SPSite -Limit All | Get-SPWeb -Limit All | select ID, Title, Author, Url, WebTemplate, LastItemModifiedDate, IsRootWeb | Export-CSV $bkdir\SPWeb.csv
#Get Site Admin Data
Write-Host("Getting Site Administration Data")
Get-SPSiteAdministration -Limit All | Select Url, Title,OwnerLoginName, SecondaryContactLoginName, UsersCount, RootWebTemplate | Export-CSV $bkdir\SPSiteAdmin.csv
#Get SandBox Solutions
Write-Host("Getting SandBox Solutions")
Get-SPSite -Limit All | Get-SPUserSolution | select Name, SolutionId, Status, HasAssemblies | Export-CSV $bkdir\SPUserSolution.csv
#Get Process Accounts
Write-Host("Getting Process Accounts")
Get-SPProcessAccount | select Name, SecurityIdentifier | Export-CSV $bkdir\SPProcesAcct.csv
#Get Managed Accounts
Write-Host("Getting Managed Accounts")
Get-SPManagedAccount | select TypeName, UserName, DiplayName, Sid, AutomaticChange, Name, Id, Status | Export-CSV $bkdir\SPManagedAccts.csv
#Get Alternate URLs
Write-Host("Getting Alternate URLs")
Get-SPAlternateUrl | select IncomingUrl, UrlZone, PublicUrl | Export-CSV $bkdir\SPAlternateUrl.csv
#Get Managed Paths
Write-Host("Getting Managed Paths")
Get-SPWebApplication | Get-SPManagedPath | Export-CSV $bkdir\SPManagedPath.csv
#Get Solutions
Write-Host("Getting Farm Solutions")
Get-SPSolution | select SolutionId, Name, DisplayName, Deployed, DeploymentState, SolutionFile, ContainsGlobalAssembly, ContainsWebApplicationResource, JobExists, Version | Export-CSV $bkdir\SPSolution.csv
#Get Features
Write-Host("Getting Features")
Get-SPFeature | select SolutionId, Name, DisplayName, Scope, RootDirectory, Status | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id | Export-CSV $bkdir\SPFeature.csv
#Get SP Databases
Write-Host("Getting SP Databases")
Get-SPDatabase | select DisplayName, Server, ID, Status | Export-CSV $bkdir\SPDatabase.csv
#Get Content Databases
Write-Host("Getting Content Databases")
Get-SPContentDatabase | select Name, DisplayName, Id, Server, PreferredTimerServiceInstance, CurrentSiteCount, WarningSiteCount, MaximumSiteCount, WebApplication, Exists, IsReadOnly, DiskSizeRequired, NeedsUpgradeIncludeChildren, NeedsUpgrade, Status, Version | Export-CSV $bkdir\SPContentDatabase.csv
#Get Services
Write-Host("Getting Service Intances")
Get-SPServiceInstance | select TypeName, Service, Id, Server, NeedsUpgradeIncludeChildren, NeedsUpgrade, Status, Version | Export-CSV $bkdir\SPServiceIntances.csv
#Get Service Applications
Write-Host("Getting Service Applications")
Get-SPServiceApplication | select Name, DisplayName, TypeName, Id, IisVirtualDirectoryPath, ApplicationPool, Service, DefaultEndpoint, Version | Export-CSV $bkdir\SPServiceApplication.csv
#Get Web Templates
Write-Host("Getting Web Templates")
Get-SPWebTemplate | select ID, Title, Name, Description, Lcid, IsCustomTemplate, IsRootWebOnly, IsSubWebOnly | Export-CSV $bkdir\SPWebTemplate.csv
#Get Service Application Pools
Write-Host("Getting Service Application Pool Accounts")
Get-SPServiceApplicationPool | select Id, Name, ProcessAccountName | Export-CSV $bkdir\SPAppPoolAccounts.csv
No comments:
Post a Comment