-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTDM Standard.ps1
More file actions
55 lines (44 loc) · 1.73 KB
/
TDM Standard.ps1
File metadata and controls
55 lines (44 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## Subset Prod into Subset based on Where Clause in Options file ##
$Database = "SqlServer"
$Options = 'C:\Github\TDM\End-to-End\SQL\options.json'
$Output = 'C:\Github\TDM\End-to-End\SQL\Subset_Log.json'
$Log = 'Verbose'
## Source Database ##
$SourceHost = "127.0.0.1"
$SourcePort = 1988
$SourceDB = 'NewWorldDB'
$SourceUser = 'Redgate'
$SourcePassword = 'Redg@te1'
## Target Database ##
$TargetHost = "127.0.0.1"
$TargetPort = 1988
$TargetDB = 'NewWorldDB_Subset'
$TargetUser = 'Redgate'
$TargetPassword = 'Redg@te1'
rgsubset.exe rgsubset run `
--database-engine $Database `
--source-connection-string "Server=$SourceHost,$SourcePort;Database=$SourceDB;Trust Server Certificate=yes;User ID=$SourceUser;Password=$SourcePassword" `
--target-connection-string "Server=$TargetHost,$TargetPort;Database=$TargetDB;Trust Server Certificate=yes;User ID=$TargetUser;Password=$TargetPassword" `
--target-database-write-mode Overwrite `
--options-file $Options `
--log-level $Log `
--output-file $Output
pause
## Begin process of Masking Target Database ##
## Classifying Table Structure of Target Database ##
rganonymize.exe classify `
--database-engine $Database `
--connection-string "Server=$TargetHost,$TargetPort;Database=$TargetDB;Trust Server Certificate=yes;User ID=$TargetUser;Password=$TargetPassword" `
--classification-file classification.json `
--output-all-columns
pause
## Mapping Table Structure ##
rganonymize.exe map `
--classification-file classification.json `
--masking-file masking.json
pause
## Masking Target Database ##
rganonymize.exe mask `
--database-engine $Database `
--connection-string "Server=$TargetHost,$TargetPort;Database=$TargetDB;Trust Server Certificate=yes;User ID=$TargetUser;Password=$TargetPassword" `
--masking-file masking.json