Data Masker Powershell

Folks,

I'm trying run a Data Masking Set through Powershell, as we will be pushing out masking from a central location.  I've tried the code on the current help page 
https://www.red-gate.com/hub/product-learning/sql-clone/how-to-automatically-provision-sanitized-data-using-sql-clone-data-masker-and-powershell

That page references an application in \Red Gate\Data Masker for SQL Server\DataMasker.exe, but I have a different path/application: \Red Gate\Data Masker for SQL Server 6\DataMaskerCmdLine.exe.

Has anyone been successful running Powershell to execute the Data Masker and run a masking set from code like:
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{   
## $arguments = "& 'C:\Program Files\Red Gate\Data Masker for SQL Server 6\DataMaskerCmdLine.exe' 'F:\TFS\DBA\Data Masking - Obfuscation\Redgate Masking Sets\BO_TablesMasking.DMSSet' -R -X | out-null"
Start-Process powershell -Verb runAs -ArgumentList "& 'C:\Program Files\Red Gate\Data Masker for SQL Server 6\DataMaskerCmdLine.exe' 'F:\TFS\DBA\Data Masking - Obfuscation\Redgate Masking Sets\BO_TablesMasking.DMSSet' -R -D 'RobbKW-10\Robb[appdev_bo] = RobbKW-10\Robb[demo]' -X | out-null"
Break
}
??

Thanks,
Robb


Best Answer

  • Robb_KellerRobb_Keller Posts: 21 Bronze 1
    Folks!
    I finally got the Powershell to run the data masking.  I was referencing the wrong app, which IS DataMasker.exe, NOT DataMaskerCmdLine.exe.  The file was wrong on extension too.

    Thanks anyway for consideration, but I'm good to go.

    Robb

Answers

Sign In or Register to comment.