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

Assembly Microsoft.Dynamics.Service.Plugins.dll can not be loaded. Dynamics CRM 365 Engine version 9 - CRM User creation error

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified at Configuration class initiation in CrmServiceHelper.cv