To retrieve a list of SharePoint databases. When you run Get-SPDatabase , you are provided the Name, Id, and Type of SharePoint databases. PS C:\> Get-SPDatabase If you run Get-SPDatabase | Select Name, only the database name is brought in entirety. PS C:\> Get-SPDatabase | Select Name If you want to save the output to a file. Then use Out-File parameter. Like that : PS C:\>Get-SPDatabase | Sort-Object Name | Select Name | Out-File C:\SharePointDBList.txt The below script builds a script that returns all the databases where the name doesn’t match the name from the SharePoint databases. $file = New-Item -type file "C:\SPDBs.txt" -force add-content $file "select name from sys.databases where name not in (" Get-SPDatabase | foreach-object{add-content $file $_.Name} add-content $file ")" ii $file
Your comprehensive resource for Microsoft 365 productivity solutions. Explore expert tutorials, best practices, and real-world implementations for SharePoint Online, Power Platform (Power Apps, Power Automate, Power BI), Microsoft Copilot and Python. Whether you're building automated workflows, creating custom apps, managing SharePoint sites, or leveraging AI with Copilot, find practical guides and insights to transform your digital workplace