Tag: SMO (Page 2/5)

#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 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
#PSTip Get Active Database Connections of a SQL Database
Note: This tip requires PowerShell 2.0 or above. As a part of SQL SMO automation, when we want to detach…
Read More
#PSTip Change database recovery model using SMO
Note: This tip requires PowerShell 2.0 or above. Database mirroring requires that the database be in Full recovery model as…
Read More