Tuesday, November 12, 2019

Get all DFS Folder targets of a DFS path

Find attached the script to get the DFS folder targets. The targets will be saved to c:\temp\DFSFolderTargets.csv. Just change the variable $DFSPath = "\\Domainfqdn\Folder\*" to your DFS path.

$DFSPath = "\\Domainfqdn\Folder\*"
$DFSPath
$DFSNFolders = Get-DfsnFolder $DFSPath
foreach($DFSNFolder in $DFSNFolders )
    {
    $DFSTarget = Get-DfsnFolderTarget $DFSNFolder.Path | Select Path,TargetPath
    $DFSTarget | Export-Csv "c:\temp\DFSFolderTargets.csv" -NoTypeInformation -Append
    }

No comments:

Post a Comment