PowerShell script exchange
Post Reply
zahradnik
Novice
Posts: 5
Liked: never
Joined: Nov 21, 2017 8:23 pm
Full Name: Jan Zahradník
Contact:

Wrong credentials for restoring MSSQL database

Post by zahradnik »

I'm trying to restore a Microsoft SQL database to another server, but the script failes connecting to the server. Credentials are correct. Error message doesn't help me a lot

Code: Select all

PS C:\Users\Administrator> $sqlCred = New-Object System.Management.Automation.PSCredential ("sa", $(ConvertTo-SecureString “sql-secret” -AsPlainText -Force))
PS C:\Users\Administrator> $guestCred = New-Object System.Management.Automation.PSCredential ("10.68.12.43\localAdmin", $(ConvertTo-SecureString "win-secret" -AsPlainText -Force))
PS C:\Users\Administrator> Invoke-Command -ComputerName 10.68.12.43 -Credential $guestCred -ScriptBlock { whoami }
triton5\localAdmin
PS C:\Users\Administrator> Restore-VESQLDatabase -Database $db -DatabaseName $RestoreDbName -ServerName "10.68.12.43" -TargetFolder "D:\SqlData" -Force -UseSQLAuthentication -SqlCredentials $sqlCred -GuestCredentials $guestCred -Verbose
Error: Restore-VESQLDatabase : Failed to validate guest credentials for remote mount.
Andreas Neufert
VP, Product Management
Posts: 6747
Liked: 1408 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Wrong credentials for restoring MSSQL database

Post by Andreas Neufert »

Hello Jan, it is hard to say based on the above. Can you please open a support ticket and upload logs?
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests