Monday, 14 June 2021

Get all DFS Folder Targets of a DFS Path

 Get all DFS Folder Targets of a DFS Path


 Change the Variable  $DFSPath= \\DomainFQDN\Folder\* to you 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\DFSDetails.csv" -NoTypeInformation -Append
    }
    

No comments:

Post a Comment