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 !
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