QuickBlog: Get SQL Server LOGINS using SQLPS…

SQLPS.exe (PowerShell mini-shell) means business.  You want a quick way to get information about your SQL Server logins, then here it is:

   1: cd SQLServer:\SQL\YourSQLServer_Name\Default_or_YourSQLinstance_Name\Logins
   2: dir

TWO LINES…. is that GREAT!!  

The more you discover how productive PowerShell can be, then you go crazy and want to learn more.  Hey!!  Learning to use SMO with PowerShell add more ammunition to your scripting arsenal.

Here’s a screenshot showing the logins results:

Now, to keep growing these two liner… you could add the list of SQL Server and do a “Foreach” cmdlet to build a nice report.

This is just a starting point to start using SQLPS and extending it with PowerShell v2.

Enjoy!!

Advertisements

About maxt2posh

I’m from Puerto Rico, have been working with computers since 1979. Throughout many years, I have worked with SQL Server Technologies, provided support to Windows Servers/Client machines, Microsoft Virtualization Technologies, and build some Visual Studio solutions. I’m a Microsoft PowerShell MVP since 2009 and MVP SAPIEN Technologies since 2010. I speak in most of the SQLSaturday, IT Pro and .NET camps events around the Florida’s State. Also founder of the Florida PowerShell User Group which meeting every 3rd Tuesday evening of the month.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s