DFS Namespace: Create folder structure

Hello everybody,

I was looking for a solution to create a DFS namespace (DFSN) folder structure. This because I wanted to create a shares folder and in that folder my shares and its target paths. So I was looking on the internet how to do that, but I couldn’t find the right answer.

And of course we are doing it in PowerShell! Because in large setups you do not want to do this by hand ;-).

PROBLEM:
I used the command new-dfsfolder and that command requires parameters –path and –targetpath. The PowerShell code I used was.

I used the command new-dfsfolder and that command requires parameters –path and –targetpath.
The PowerShell code I used:

The result looks like this
dfsnwrong

So I tried to create a shared folder in my shares DFSN folder, but that did not work….

The error I see was:
dfsnerror

The reason is because the shares folder contains a target. And that was just my problem because then you cannot create subfolders in DFS….

SOLUTION:
After some digging into the folders of my DFSN I saw something interesting.

Use:

The result will look like this

The path and NamespacePath are important for our solution.

So I used the similar paths to create my shares folder in DFSN including .DFSFolderLink.

After these lines of code, I was able to create share under the shares folder.

Result:

dfsnoke

Have Fun creating you’re DFS namespace!

About the Author

Sander

No Comments

Comments are closed.