From: markm75g on
Is there a way, to make a backup of a network share in 2008 r2, then delete
the share, but run a command to recreate it, maybe outside of windows backup?

I use DPM 2010, but it fails to recreate the share if you do the restore, it
only recreates the folder, not the actual share.

What would be the easiest way to do this.. maybe self contained on the
server itself, so that when i run the dpm backup of the server or virtual
server, it could be restored if need be?

Thanks


From: Pegasus [MVP] on


"markm75g" <markm75g(a)discussions.microsoft.com> wrote in message
news:37C6A72F-1207-419C-B9B8-556F8BFCBA9A(a)microsoft.com...
> Is there a way, to make a backup of a network share in 2008 r2, then
> delete
> the share, but run a command to recreate it, maybe outside of windows
> backup?
>
> I use DPM 2010, but it fails to recreate the share if you do the restore,
> it
> only recreates the folder, not the actual share.
>
> What would be the easiest way to do this.. maybe self contained on the
> server itself, so that when i run the dpm backup of the server or virtual
> server, it could be restored if need be?
>
> Thanks
>
>

The command "net share" will enumerate all existing shares. The command

net share "User Files"=d:\UserFiles

will create a share. To process the output from the "net share" command and
turn it into a number of commands that will recreate shares would require a
small amount of scripting.

The alternative is to extract the shares information from
hklm/system/currentcontrolset/services/lanmanserver/shares, then use it when
recreating the shares.