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

Enjoy!

Happy Learning.

Thanks,
Sarabpreet Singh

Sarabpreet Singh Anand

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”.

You may also like...

1 Response

  1. July 14, 2012

    […] Wait a min, Where are my System Databases? (http://www.sarabpreet.com/?p=294) […]

Leave a Reply