Tag: SQL (Page 3/7)

#PSTip Finding all roles a particular login is mapped to in all databases

Note: This tip requires PowerShell 2.0 or above. In a previous tip, we checked out how to get the names…

Read More

#PSTip Finding all databases to which a login is mapped

Note: This tip requires PowerShell 2.0 or above. One of the projects on which I work requires a validation step…

Read More

#PSTip Validate if a SQL login exists using PowerShell

Note: This tip requires PowerShell 3.0 or above. Before performing tasks like adding roles to a SQL login, it is…

Read More

#PSTip Add a SQL login to database roles using SMO

Note: This tip requires PowerShell 2.0 or above. We can use SQL Server SMO object to add a SQL login…

Read More

#PSTip Retrieve all SQL instance names on local and remote computers

I was looking at way to retrieve the SQL instance names on a remote computer without using SQL SMO. This…

Read More

#PSTip Drop all Active Connections of SQL Database

Note: This tip requires PowerShell 2.0 or above. In an earlier tip, we looked at how we can retrieve the…

Read More