Necessity is the mother of new PowerShell code :-)! Today, I had to unmask all the columns I had helped mask using Dynamic Data Masking. This simple post assumes that you are a privileged user with the ability to drop "Column Masking"! Identify Masked Columns The SQL to identify all masked columns is pretty simple … Continue reading PowerShell & SQL Server: Unmask All Masked Columns (Dynamic Data Masking) In Database
Category: dbatools module
SQL Server: Disable/Remove Indexes Across Servers/Databases Using PowerShell & dbatools
This is something I had to do today. In this blog post, I am going to show you how you can disable or remove indexes matching certain name criteria or other condition(s) across multiple servers and databases in various tables. Usually, this is a very painful process if done by hand but with the fantastic … Continue reading SQL Server: Disable/Remove Indexes Across Servers/Databases Using PowerShell & dbatools
PowerShell/dbatools Tip – Clone a login / database user
One of the more frequent requests that a SQL Server DBA receives is to "Clone a login" with all its permissions. For example a request could be Clone BILL_BLACK's login and create a new login JACK_JOHNSON with exactly the same privileges in all databases. Clone AD group login BILLING_APP_ADMINS and create a login for new … Continue reading PowerShell/dbatools Tip – Clone a login / database user
PowerShell & SQL Server: Search & Find Indexes By SchemaName, TableName, IndexName Or ColumnName Across Instances/DB’s
Necessity is the mother of new PowerShell code :-)! Today, I received an email request to get the list of all indexes in a given TableName but the requester did not specify the DatabaseName although the SQL InstanceName was specified. It would be too easy to ask the person for the DBName and script it … Continue reading PowerShell & SQL Server: Search & Find Indexes By SchemaName, TableName, IndexName Or ColumnName Across Instances/DB’s
PowerShell: Drop All SQL Server Tables, Views, SP’s, Functions, Types etc.
I hope this script does not become infamous for the wrong reasons! Please use caution. I had to help a team recreate everything in a database and test their scripts but leave the roles and role grants in place. Basically, this meant that I could have scripted out the permissions and recreated the database but … Continue reading PowerShell: Drop All SQL Server Tables, Views, SP’s, Functions, Types etc.