Skip to content

Commit

Permalink
made it more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Apr 18, 2016
1 parent 484b4cb commit 242329b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Functions/Copy-SqlLogin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ param(
$destlogin.set_Sid($sourcelogin.get_Sid())

$defaultdb = $sourcelogin.DefaultDatabase
Write-Output "Setting login language to $($sourcelogin.Language)"
$destlogin.Language = $sourcelogin.Language

if ($destserver.databases[$defaultdb] -eq $null) {
Expand Down Expand Up @@ -299,7 +300,9 @@ param(
}
# Attempt to add Windows User
elseif ($sourcelogin.LoginType -eq "WindowsUser" -or $sourcelogin.LoginType -eq "WindowsGroup") {
Write-Output "Adding as login type $($sourcelogin.LoginType)"
$destlogin.LoginType = $sourcelogin.LoginType
Write-Output "Setting language as $($sourcelogin.Language)"
$destlogin.Language = $sourcelogin.Language

try {
Expand Down Expand Up @@ -661,6 +664,10 @@ PROCESS {
$elapsed = [System.Diagnostics.Stopwatch]::StartNew()
$started = Get-Date

If ($Pscmdlet.ShouldProcess("console","Showing time elapsed message")) {
Write-Output "Migration started: $started"
}

if ($source -eq $destination) { throw "Source and Destination SQL Servers are the same. Quitting." }

$script:skippedlogin = @{}; $script:migratedlogin = @{};
Expand Down

0 comments on commit 242329b

Please sign in to comment.