#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 to the database roles.
Read MoreNote: This tip requires PowerShell 2.0 or above. We can use SQL Server SMO object to add a SQL login to the database roles.
Read MoreNote: This tip requires PowerShell 4.0 or above. Starting in Windows PowerShell 4.0 with the new Desired State Configuration (DSC) feature, we now have one more command type added to the list of command types: Configuration.
Read MoreHere’s another cool variables tip. Say you want to initialize a few variables to a specific value. Instead of doing:
Read MoreIn the previous tip I showed how we can use multiple assignments to swap the value of two or more variable values.
Read MoreIn most programming languages the conventional way to swap the value of two variable is to use a third variable.
Read MoreI was looking at way to retrieve the SQL instance names on a remote computer without using SQL SMO. This is essential for me as I don’t always expect to have the SQL SMO DLLs on the computer where I run my scripts.
Read More