Featured image of post Monitoring with PowerShell: Monitoring DFSR status

Monitoring with PowerShell: Monitoring DFSR status

There were a couple of projects I was working on, one of them being a method to upload intune applications to all tenants in a CSP. Turns out that someone else already made that so I won’t be blogging about it directly. If your interested in that you can check out this link. This did swallow most of my time, so instead I figured I’d publish a smaller blog today.

So instead we’re going to focus on monitoring something else entirely; DFS Replication. DFS is somewhat dated when compared to cool new tech like Azure File Sync, and others like that but still used in a lot of environments. Even in our move to cloud only environments I still think we have a handful of DFS servers running.

This small script will assist you in finding DFS machines that are having an increased backlog, connection issues, or folder issues.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
$MaxBackLog = "100"
$DFSFiles = Get-DfsrState
$DFSBackLogHealth = if ($DFSFiles.count -gt $Maxbacklog) { "There are more than $Maxbacklog in the backlog" } else { "Healthy" }

$connections = Get-DfsrConnection | Where-Object {$\_.state -ne 'normal'}
$DFSConnectionHealth = if($Connections) { "Fault connections found. Please investigate" } else { "Healthy" }

$Folders = Get-DfsReplicatedFolder | Where-Object {$\_.state -ne 'normal'}
$DFSFolderHealth = if($Folders) { "Faulty folder found. Please investigate" } else { "Healthy" }

I know it’s a little shorter than my normal blogs. I just couldn’t find a new cool subject to talk about. If you have any suggestions please let me know. I’m still doing requests 🙂

All blogs are posted under AGPL3.0 unless stated otherwise
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy