Does anyone know the powershell commands to restore a remote database from a local file?
Does anyone know the powershell commands to restore a remote database from a local
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Based on your comment, there are no PowerShell-specific commands. You’ll need to use New-PSDrive to map a drive to the server, use Copy-Item to copy the database over to the server, and then use one of the SQL 2008 commands (there are 2 total) to execute the necessary RESTORE DATABASE command. SQL2008 hasn’t shipped anything more specific than that, and the SQL Server product itself can’t perform a restore from a remote path (well, maybe a UNC, but I assume you’re on a client – it’d be easier to copy the backup to the server).