Get-DbaRandomizedValue View Source Sander Stad (@sqlstad, sqlstad.nl) Windows, Linux, macOS Synopsis Generates random data values for SQL Server data types or specialized data patterns for data masking and test data creation
Description Creates realistic fake data by generating random values that match SQL Server data type constraints or using specialized data patterns like names, addresses, and phone numbers.
This function is essential for data masking in non-production environments, replacing sensitive production data with believable fake data while maintaining referential integrity and data patterns.
Sander Stad (@sqlstad, sqlstad.nl) | Chrissy LeMaire (@cl, netnerds.net)
Invoke-DbaDbDataMasking View Source Sander Stad (@sqlstad, sqlstad.nl) , Chrissy LeMaire (@cl, netnerds.net) Windows, Linux, macOS Synopsis Replaces sensitive production data with randomized values using configurable masking rules
Description Replaces sensitive data in SQL Server databases with randomized values based on a JSON configuration file. This enables DBAs to create safe, non-production datasets for development, testing, and training environments without exposing real customer data.
The function processes tables row-by-row, applying masking rules like generating fake names, addresses, phone numbers, or random strings while preserving data relationships and referential integrity.
Invoke-DbaDbPiiScan View Source Sander Stad (@sqlstad, sqlstad.nl) Windows, Linux, macOS Synopsis Command to return any columns that could potentially contain PII (Personal Identifiable Information)
Description This command will go through the tables in your database and assess each column.
It will first check the columns names if it was named in such a way that it would indicate PII.
The next thing that it will do is pattern recognition by looking into the data from the table.
Sander Stad (@sqlstad, sqlstad.nl) | Chrissy LeMaire (@cl, netnerds.net)
New-DbaDbMaskingConfig View Source Sander Stad (@sqlstad, sqlstad.nl) , Chrissy LeMaire (@cl, netnerds.net) Windows, Linux, macOS Synopsis Scans database tables to detect sensitive data and creates a JSON configuration file for data masking
Description Analyzes SQL Server database tables and columns to automatically detect potentially sensitive information (PII) and generates a JSON configuration file that defines how to mask each identified column. The function uses pattern matching against column names and data sampling to identify sensitive data like Social Security Numbers, email addresses, phone numbers, and other PII based on predefined patterns and known column naming conventions.
Test-DbaDbDataMaskingConfig View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Validates data masking configuration JSON files for structural and logical errors
Description Validates data masking configuration JSON files by checking column properties, data types, masking types, and action configurations against dbatools requirements.
Returns detailed error information for any tables and columns that fail validation, helping you identify configuration issues before running data masking operations.
Checks include required/allowed column properties, supported SQL Server data types, valid masking and subtype combinations, date range validations, and action property requirements.