
The various types of backups that you can create are as follows: SQLCMD is the newest, fanciest command-line interface for SQL Server. Sqlcmd -E -S touch -Q" RESTORE DATABASE FROM DISK = 'D:\BACKUP\Testing. To restore use the following in the SQLCMD window: Sqlcmd -E -S touch -Q" BACKUP DATABASE TO DISK = 'D:\BACKUP\Testing. Now click Start, click Run, type CMD in the Run dialog box, and then click OK then a black window is opened.įor a backup enter the following in the SQLCMD window: A restore scenario in SQL Server is the process of restoring data from one or more backups and then recovering the database. A backup scenario in SQL Server is the process of copying the data from a SQL Server database and creating a backup file. It works across all supported operating systems, whether they are 64-bit or 32-bit systems. It's one of the most important responsibilities for DBAs. One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.In this article I am explaining how to do backup and restore using a SQLCMD and T-SQL command prompt. Now your users can backup their PST files – If they remember to do it 🙂

Save it as BackupOutlook.bat and throw it on their desktop. I added an error handler, so the user will be notified if the copy could not complete. Here is what the final bat file would look likeĬOPY %LOCALAPPDATA%\Microsoft\Outlook\*.pst \\server\backup\%USERNAME% errorlevel 1 goto "= Backup Failed "= Backup Complete "=" The ability to close Outlook (So the user does not have to remember to do this), and a way to find and copy our PST files. y – This allows us to overwrite without being prompted. For our backup, we will copy it to a share named backup, and we will copy it to a folder matching the users name.ĬOPY %LOCALAPPDATA%\Microsoft\Outlook\*.pst \\server\backup\%USERNAME% /y We can use an environment variable to find this. Most of the time PST files are located in the users AppData folder. The bat file will run CloseOutlook.vbs, and then copy the PST files. Now, we will use this script, in combination with a bat file.

Set Outlook = CreateObject("Outlook.Application") We will accomplish this with a little bit of VB Script:

Now it is not foolproof, but it will work most of the time.įirst, we need our script to close Outlook, that way the PST files will not be in use. I want to have an icon on their desktop that they can click to backup Outlook before they leave for the weekend. All of my users store their email in PST files in Outlook. I have a small network of about 10 laptops.
