• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

PowerShell with SQL Server SMO BackupDirectory

Within PowerShell, is the SMO.Settings.BackupDirectory a read-write property. If it can be written to, does that affect the value that has been stored for the database server, or is it just for that invocation of the object?

I am using the Microsoft.SqlServer.Management.Smo.Server object to perform a backup of the database before running the script. The client does not want the backup stored in the default folder. If changing this setting changes it for the database, then I will need to retrieve the current value and save it, perform the backup, then set it back to the original value, so I need to know the scope involved if I change the value.
1 Solution
dbbishopAuthor Commented:
well, had a lull in my 12-hour work day, so I ran a quick test (sometimes asking can get faster results). In case anyone is interested, it is only for that session. The default value does not get changed.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now