| Below are the most used Power Shell commands for SharePoint administrator and these are also the basic commands.
(1)To get the current build version of SharePoint
get-spfarm |select buildversion
(2)To get the list of Shell administrators:
Get-SPShellAdmin
(3)To add a user as to a Shell administrator:
Add-SPShellAdmin -UserName user_name -Database database_name
(4)Command to remove a user from Shell Admin:
Remove-SPShellAdmin -UserName user_name -Database database_name
(5)How to know the deleted site
Get-SPDeletedSite | select Path , siteid
(6)Commmand to restore the deleted site
Restore-SPDeletedSite -Identity (SiteId)
(7)How to check the error on a content database
Test-SPContentDatabase -name WSS_Content_DB –webapplication
(8)How to do Backup
Backup-SPSite -Identity SiteCollectionGUIDorURL -Path Backup_File [-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose]
(9)How to Restore
Restore-SPSite -Identity SiteCollectionURL -Path Backup_file [-DatabaseServer DatabaseServer_Name] [-DatabaseName ContentDatabase_Name] [-HostHeader Host_header] [-Force] [-GradualDelete] [-Verbose]
(10)How to Deploy
Add-SPSolution mention_path
Install-SPSolution -Identity filename.wsp -AllWebApplications -GACDeployment
Enable-SPFeature Projectfile_feature1 -url http://[ServerName]/ –force
(11)When we need to install patches and to Update the SharePoint Database we must manually run psconfig
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
(12)To get the sharepoint database
Get_SPDatabase
(13)Command to know the site collection under specified webapplication
Get-SPWebApplication url_upto_webapp | Get-SPSite -LimitAll
(14)Command to know the sites under specified site collection
Get-SPSite urlofsite | Get-SPWeb -LimitAll | | |