PowerShell & SQL Server: Unmask All Masked Columns (Dynamic Data Masking) In Database

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

Advertisement

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 & 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.