how to backup a database from clients via Windows PowerShell

You may need to backup a database remotely via Windows Power Shell.

First of all, you have to install SQL Server PowerShell applet to local machines.

to verify if Applet exists:

1 - Open Windows PowerShell (It is highly recommended to open it with Administrator)
2 - Enter sqlps, if you get an error about unrecognized command. You have to install SQL Client tools or any other feature from SQL Server Installation Disc. (Feature based installation covers necessary Power Shell Scripts)

Second, execute below commands over Windows PowerShell to backup a database;

PS C:\Users\[....]> sqlps
Microsoft (R) SQL Server (R) PowerShell
Version 12.0.2000.8
Copyright (c) 2014 Microsoft. All rights reserved.

PS SQLSERVER:\>; Backup-SqlDatabase -ServerInstance dbaseServer050 -Database CrmOrganization_MSCRM -BackupFile \\ShareMap\BackupTemp\CrmOrganization_MSCRM.bak

PS SQLSERVER:\>


Good Luck...

Comments

Popular posts from this blog

Complex Query in QueryExpression in Microsoft CRM 2011

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Microsoft Power Apps Portal integration with Dynamics 365 CE On-Premise - Step By Step Guide