Data Masker Powershell
Robb_Keller
Posts: 21 Bronze 1
in SQL Clone
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:
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
??
Thanks,
Robb
Best Answer
-
Robb_Keller Posts: 21 Bronze 1Folks!
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