|
Hey gang, Anyone have a snippet to retrieve the default backup and data folders using PowerShell? Thanks!
(comments are locked)
|
|
See if this helps. You can paste this into Powereshell ISE and run. Weird... it appears that Settings.DefaultFile and Settings.DefaultLog aren't "populated" until you actually set them to something. Can someone else try the code on a fresh install and see if they get the same experience of blank results?
May 02 '11 at 06:42 AM
Blackhawk-17
(comments are locked)
|
|
Getting the backup folder returned no problem... The data and log entries are coming back empty.
Apr 30 '11 at 10:01 PM
Blackhawk-17
(comments are locked)
|
|
We have drive and configuration standards for all SQL installs. By default SQL uses the install directory. Do you have databases on the server? Can you create a database within SSMS? Where does it put the data and log files? Here is a link to MSDN about default installation, may be of some help. http://msdn.microsoft.com/en-us/library/ms143547.aspx I support many different Clients and, between various standards and legacy installs, I can not be assured that the default will be the correct location. Often the data files are on one SAN LUN under a Data directory and the log files are on a different LUN under Logs.
May 02 '11 at 10:15 AM
Blackhawk-17
(comments are locked)
|


I'll give the answer to @sqlaj but I'd still like to know if others get a blank on default installs or if the variables are populated.
@Blackhawk-17 I get the backup directory populated but other 2 are blanks.
@Oleg - if you change them in SSMS are they populated then? And if you change them back to the original defaults are they still populated (mine are)?