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?
Comments
1 comment
-
Hello Glenn,
Thanks for your inquiry with SQL Clone.
This should be possible via theRedGate.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-sqlcloneimageConnect-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!
Add comment
Please sign in to leave a comment.