PowerShell script exchange
zahradnik
Novice
Posts: 5 Liked: never
Joined: Nov 21, 2017 8:23 pm
Full Name: Jan Zahradník
Contact:
Post
by zahradnik » Jun 01, 2021 2:24 pm
this post
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: 7081 Liked: 1511 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:
Post
by Andreas Neufert » Jun 02, 2021 7:05 am
this post
Hello Jan, it is hard to say based on the above. Can you please open a support ticket and upload logs?
Users browsing this forum: No registered users and 6 guests