SQLPS Powershell in SQL Server -2

Ok , so now we are connected to SQLPS
We will first navigate to different folders of SQL Server



Run this Command
Dir
It will show list of all available folders





Now run this command

CD SQL

It will give hostname
In my case its
CD  <hostname>
I have masked hostname of my server

Then CD TEST
here TEST is instance name of SQL Server




So now we are connected to current instance of SQL Server
Now Run DIR command
It will give list of objects which we can see in SSMS while connecting to server

We want to get list of all databases
So run this command

CD DATABASES
Then DIR

It will give list of all databases




Now get out of DATABASEs
CD..
Then CD LOGINS-> DIR

It will give list of All Logins





1 comment:

Unknown said...

Nice!

Post a Comment

Popular Posts