Forum Discussion
Stefan T
May 25, 2018Copper Contributor
Automate the recreation of network shares on a new fileserver
0 I exported the shares of a MSFC running W2008r2 I plan to present the diskcopies (via storage) on my new server I want to set to automate the process of recreating the shares as they...
Steve Norton
May 26, 2018Brass Contributor
Does this work for you?
$p="c:\1","c:\2"
$s="share1","share2"
For ($i=0; $i -lt 2; $i++)
{
$Share = $s[$i] + "=" + $p[$i]
net share $Share /GRANT:EVERYONE,FULL
}