O'Reilly logo

SQL Server 2014 with PowerShell v5 Cookbook by Donabel Santos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listing logins, users, and database mappings

This recipe lists logins and their corresponding usernames through database mappings.

Getting ready

To check logins and their database mappings in SQL Server Management Studio, log in to SSMS. Go to the Security folder, expand Logins, and double-click on a particular login. This will show you the Login Properties window. Click on the User Mapping option on the left-hand pane, as shown in the following screenshot:

Getting ready

How to do it...

To list logins, users, and database mappings, let's use the following steps:

  1. Open PowerShell ISE as an administrator.
  2. Import the SQLPS module and create a new SMO Server Object as follows: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required