Where are my system databases?
Hi Friends,
In last post, we saw that we can very easily use powershell to connect to SQL Server instance and see all the available databases (http://www.sarabpreet.com/?p=288), but by default powershell maintains security and hide all system level databases. Now the question arises how to list\view system databases in powershell.
Well to do this, all you have to do is use an extra switch called FORCE, this forces powershell to show all content.
let’s see how to use this.
If we use the normal get-childitem cmdlet it will just display the user databases like the below screenshot.
Now let’s use the force switch, Like: get-childitem –force, this will change the default behavior and show all Databases including System Databases.
Enjoy!
Happy Learning.
Thanks,
Sarabpreet Singh
Pingback: How to Connect to SQL Server using Powershell » Powershell4SQL User Group