Adam Ocsvari
Adam Ocsvari

Reputation: 8386

Publishing DFS replication to a Namespace

I'm creating a chef cookbook which runs on 2 Windows boxes

The recipes are calling PowerShell commands to automate these tasks. This is working well.

What I still need to to is creating a Namespace and Publishing the replication in that Namespace.

Based on this tutorial, I managed to do it in no time with the DFS Management UI.

I need a way to do it with PowerShell or with anything what I can call from Chef.

Note: If I can publish the replication to an already existing Namespace, that's already a half solution for me.

Update: I'm using Windows 2012 R2. ( The latest version provided on AWS.)

Upvotes: 1

Views: 2272

Answers (1)

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200463

On Server 2012 R2 you can use the DFS cmdlets for DFS administration.

$path   = '\\server\share'
$domain = 'example.org'
$ns     = 'mynamespace'
$group  = 'RGroup'
$name   = 'myreplicatedfolder'

New-DfsnRoot -TargetPath $path -Type DomainV2 -Path "\\$domain\$ns"
New-DfsReplicatedFolder -GroupName $group -FolderName $name `
  -DfsnPath "\\$domain\$ns\$name"

I don't have access to a DFS environment right now, but somthing like the above should work.

Upvotes: 1

Related Questions