Skip to content

Instantly share code, notes, and snippets.

@tech-zombie
Last active July 24, 2018 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tech-zombie/751acfbf52282a7253d8e207507f8674 to your computer and use it in GitHub Desktop.
Save tech-zombie/751acfbf52282a7253d8e207507f8674 to your computer and use it in GitHub Desktop.
Mass create DFSR folders in group
$folders =
$groupname =
$rootpath =
foreach ($folder in $folders)
{
$path = $rootpath + $folder
New-DfsReplicatedFolder -GroupName $groupname -FolderName $folder
Set-DfsrMembership -GroupName $groupname -FolderName $folder -ComputerName WEB1 -ContentPath $path -PrimaryMember $true -force
Set-DfsrMembership -GroupName $groupname -FolderName $folder -ComputerName WEB1,WEB2 -ContentPath $path -Force
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment