Can run run a masking as part of a clone template.
glennsharrock
Posts: 6 New member
in SQL Clone
I know you can add a masking set as a modification when creating a clone. But can you run a masking set against a clone, has part of a clone template?
Tagged:
Answers
Thanks for your inquiry with SQL Clone.
This should be possible via the
RedGate.SqlClone.Client.Api.Objects.ModificationScriptResource
modifications parameter mentioned in this page:https://documentation.red-gate.com/clone/automation/powershell-cmdlet-reference/new-sqlclonetemplate|
You can see an example of this in action below via Example 5:
https://documentation.red-gate.com/clone/automation/powershell-cmdlet-reference/new-sqlcloneimage
Connect-SqlClone -ServerUrl 'http://sql-clone.example.com:14145'$SqlServer = Get-SqlCloneSqlServerInstance -MachineName 'WIN201601' -InstanceName 'SQL2016'$ImageDestination = Get-SqlCloneImageLocation -Path '\\red-gate\data-images'
$maskingScript = New-SqlCloneSqlScript -Path \\red-gate\data-scripts\mask-emails.sql$permissionsScript = New-SqlCloneSqlScript -Path \\red-gate\data-scripts\change-permissions.sql
$ImageOperation = New-SqlCloneImage -Name "AdventureWorks-$(Get-Date -Format yyyyMMddHHmmss)" `-SqlServerInstance $SqlServer `-BackupFileName @('\\red-gate\backups\AdventureWorks-201701012210.bak') `-Destination $ImageDestination `-Modifications @($maskingScript, $permissionsScript)
$ImageOperation | Wait-SqlCloneOperationPlease let me know if you have any other questions or concerns on this.
Thanks!
Sean Quigley | Product Support Engineer | Redgate Software
Have you visited our Help Center?