compwiz32 / PSADHealth

A toolkit of AD specific health checks that you can run in your environment to ensure your Active Directory is running optimally.
GNU General Public License v2.0
149 stars 19 forks source link

About Test-ADServices function #106

Open Rapidhands opened 3 years ago

Rapidhands commented 3 years ago

Hi Mike (it's my - or your- day to check your module :-) ), 3rd post To get $DCList you use (get-adgroupmember "Domain Controllers").name Sure, it's correct but not on all cases. I'm currently loggued on a DC on french language. It's not the name for this group (Contrôleurs de domaine), houch ! May i suggest you use Get-AdDomainController cmdlet and filter on property Name of course ? Like this ; (Get-ADDomainController -filter *).HostName

Same suggest as the other function : Send-mailmessage optional or passed as param

Another suggest : the if($s.status -eq "Stopped") is located on the foreach service loop. 5 services failed ==> 5 mails ! and this loop is on the foreach server loop. Houah ! 5 services failed on 50 dcs ! 225 mails sended ! Spam, spam, spam alert !

I'm thinking this sould be inproved.

Regards Olivier

Rapidhands commented 3 years ago

Same comment about get-adgroupmember "domain controller" for the function Test-DCOnline