Is there some obvious method I am not finding for how to setup the periodic creation of shadow copies for a given drive on a system running Windows without a GUI?
From what I can tell going to the Shadow Copies tab of disk properties and clicking the Enable button basically just creates a couple scheduled tasks. These scheduled tasks seem to use some kind of GUID unique to each volume? so this isn't something that I could easily do with a Group Policy.
There must be some simple method to enabling shadow copies from the command line right?
You'd think this should be easy, wouldn't you? Well, you'd be wrong. It's not.
Shadow Copies of Shared Folders is available in all editions of Windows Server 2008 R2. However, the user interface is not available for the Server Core installation option. To create shadow copies for computers with a Server Core installation, you need to manage this feature remotely from another computer.
If easy's out of the question... see this thread, where they try go at it the hard way. I love to automate things, but in this case, I think it's much more effort than just using the GUI initially.
Instead of remotely configuring the setting, you could just create a scheduled task through Group Policy. As you mentioned, the task created during the normal method uses a volume ID; its action looks something like this:
So of course the challenge for you would be making a GPO that would work for all computers.
I propose having your schedule be a small powershell snippet that finds the volume ID and calls the same command.
I'm going to assume you want to do this for the system drive. In that case, code like this should work on PowerShell 2.0+:
This is shown as 2 lines here so you can more easily see what's going on, but obviously if you intend to call your task without an external script file (which would complicate things) you would have to have it all on one line. You can separate the lines with a semi-colon, you could just embed the entire volume ID retrieval line in the string with
$()
, etc.You could also use powershell's
-EncodedCommand
parameter to deal with quoting. This lets you have a nice readable multi-line script that you can sit on a share somewhere. You base64 encode that script and then pass the entire thing to powershell with-EncodedCommand
.I can expand on those options if needed, assuming this code would meet your needs.
From a SERVER OS (not Windows 10) you can follow these steps:
This is what I use in PowerShell. Its a link to my site, but it looks a lot better than it does pasted here.
For anyone else who ends up here after all this time, it's a lot easier now. This is how I did it in Server Core 2019
-Create a shadow copy on the C drive with VSSAdmin
vssadmin add shadowstorage /for=C: /on=C: /MaxSize=10GB
-Use PowerShell to create a scheduled task that takes a copy twice daily Monday-Friday
My main problem really is that Windows 7.0, 8.1 cannot configured shadow copies on a remote system even with the RSAT tools installed.
The remote GUI methods are fine now that I realize I must be running the tool from Windows server. The various scripted and powershell methods to accomplish this would work, but I didn't really require that in most situations.
To enable and configure Shadow Copies of Shared Folders
1.Open Computer Management. 2.In the console tree, right-click Shared Folders, click All Tasks, and click Configure Shadow Copies. 3.Click the volume where you want to enable Shadow Copies of Shared Folders, and then click Enable. 4.To make changes to the default schedule and storage area, click Settings.
found here http://itsimple.info/?p=458