14 Jul

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.

default behaviour

Now let’s use the force switch, Like: get-childitem –force, this will change the default behavior and show all Databases including System Databases.

with force switch


Happy Learning.

Sarabpreet Singh

About Author:

SQLServer - MVP Sarabpreet is SQLServer MVP, Consultant, Speaker, Trainer, Blogger and Community Lead. You can find him speaking at a local UG Event or a SQL Webcast. He has 11+ years of Experience and worked with Industry Leaders. He has many SQL Certifications under his belt. His core competency lies in administration of SQL Server. Always ready to help, online \offline. His life’s mantra is “Knowledge Increases by sharing so, Pass it on”.

One thought on “Where are my system databases?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.