Script: Monitoring DFS and SYSVOL in Active Directory

  • Last Post 12 August 2018
Mahdi posted this 11 August 2018

Hello everybody!

Recently I was seeing weird stuff in STSVOL folder on my AD environment. These weired stuff were things like: missing folder in SYSVOL for a GPO, having folders in SYSVOL where there is no GPO associated to them (GPO deleted but somehow folder in SYSVOL remained!) and things like that.

So I thought myself to write a PowerShell script to do all the report and monitoring things I wish in a clear way. And I did it! The script will simply report your SYSVOL and DFSR information and will let you know most of the required information in a form of GUI.

The script is available at my TechNet profile (Inside Gallery contributions) and you can freely download it as you wish from this link. This is an image of the report which will be prepared by this script:

Also I prepared a WiKi which you can use in order to gain more info about this script by following this link.

I hope it come useful in your hands and if you find more info within this script which you want useful, let me know and I will work on the feature you like! J

Have a good day!



Order By: Standard | Newest | Votes
michael1 posted this 12 August 2018

No offense to what you’ve done – it’s a good start.


But you don’t verify admin permissions or cmdlet errors or describe where errors occur.


You overwrite all errors (so you can’t identify the individual errors or where they occurred) and many of the various positive results. When you create objects,

many of the variables don’t have values.


I suggest you add “Set-StrictMode –Version Latest” at the top of your scripts and clean them up.



  • Liked by
  • Mahdi
Mahdi posted this 12 August 2018

Thank you Micheal! :)

I know there might be so many problems or areas that I have not covered in my script, that is why I post it here, in order to find the bugs/features which needs to be worked on.

I guess some of the points that you mentioned can be fall into category of error handling. I tried to have different try[] catch[] in order to have the best possible error handling. However can you be more precise about CMD errors that you mention? I will work trough that if you explain a little bit. :)

Also about the variable that do not have values, are you talking about the variables in script or you are talking about the columns where the values are somehow meaningless?

I am open to all ideas about monitoring SYSVOL and DFS, so do not hesitate to tell me the problems and features you think that can be good to built into the script. After all, I use the script myself too. :D