title: Get DFS Server name and local path from UNC path
body: <p>I'm working on Windows Server 2012 which comes by default with various <a href="https://technet.microsoft.com/en-us/library/jj884270.aspx" rel="nofollow noreferrer">DFS CmdLets</a>.</p>
  
  <p>What I'm trying to do is get the <code>ComputerName</code> and the <code>local path</code> of a specific UNC share, that is hosted by other DFS servers (Win Srv 2008 R2) on the domain.</p>
  
  <p><strong>An example:</strong></p>
  
  <pre><code>Get-DfsnFolderTarget -Path '\\domain.net\share\folder\'
  </code></pre>
  
  <p><strong>Expected result:</strong></p>
  
  <pre><code>ComputerName = 'Server1'
  Path         = 'E\Home\folder'
  </code></pre>
  
  <p>I'm not really a network engineer, but I can't seem to find a way to retrieve this information based on the UNC path. Every time I try the CmdLet above I get an error:</p>
  
  <pre><code>Get-DfsnFolderTarget : Cannot get DFS folder properites on "\\domain.net\share\folder\"
  At line:1 char:1
  + Get-DfsnFolderTarget -Path '\\domain.net\share\folder\'
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (MSFT_DfsNamespaceFolderTarget:ROOT\Microsoft\...aceFolderTarget) [Ge 
     t-DfsnFolderTarget], CimException
      + FullyQualifiedErrorId : Windows System Error 1168,Get-DfsnFolderTarget
  
  Get-DfsnFolderTarget : The requested object could not be found.
  At line:1 char:1
  + Get-DfsnFolderTarget -Path '\\domain.net\share\folder\'
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (MSFT_DfsNamespaceFolderTarget:ROOT\Microsoft\...aceFolderTarget) [Ge 
     t-DfsnFolderTarget], CimException
      + FullyQualifiedErrorId : MI RESULT 6,Get-DfsnFolderTarget
  </code></pre>
  
  <p>When trying a <code>Test-Path \\domain.net\share\folder\</code> it does say that it can be found. So I don't really understand.</p>
  
  <p>I'm trying to retrieve this information (<code>ComputerName</code> and <code>local path</code>):
  <a href="https://i.stack.imgur.com/oOg6s.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oOg6s.jpg" alt="enter image description here"></a></p>