What are the challenges you face when working across database platforms? Take the survey

Running Powershell script to Automate Datamasker

Hi Team,

To Automate the Datamasker using Power shell. 
Step1 : Created Par file as below 
MASKINGSET=H:\scripts\Maskercatalog\OSBDMASKSQLD01_DMaskTest (14).DMSMaskSet
LOGFILEDIR=H:\scripts\Maskercatalog\Log Files
REPORTSDIR=H:\scripts\Maskercatalog\Log Files
DATASETSDIR=C:\Program Files\Red Gate\Data Masker for SQL Server 7\DataSets

used below script in power shell 
&'H:\scripts\Maskercatalog\OSBDMASKSQLD01_DMaskTest (14).DMSMaskSet' run --parfile  $PARFILE

Concern :
Running Above script i can able to open the Maker file "OSBDMASKSQLD01_DMaskTest (14).DMSMaskSet". 
But not clear on how to Run and schedule to automate the same . Please suggest the way or any Document video reference



  • Options
    Eddie DEddie D Posts: 1,789 Rose Gold 5
    edited April 25, 2023 2:08PM
    Hi Vinay11,
    As per the support you submitted to Redgate Product Support.
    Simply create a PowerScript as per the following example:
    cd "C:\Program Files\Red Gate\Data Masker for SQL Server 7"&nbsp;<br>.\DataMaskerCmdLine.exe PARFILE="C:\MaskingSets\mymaskingset_parfile.txt"
    Obviously amend the path to the PARFILE as per your requirements.

    Save the script asd a *.ps1 file.

    Use the Windows Task Scheduler to trigger the PowerShell ps1 script at the day and time you wish the masking to take place.

    Many Thanks

    Many Thanks
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.