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
INTERIM_REPORTS=true


Step2:
used below script in power shell 
$parfile="H:\scripts\Maskercatalog"
&'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

Tagged:

Answers

  • Eddie DEddie D Posts: 1,807 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
    Eddie

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