PSADHealth icon indicating copy to clipboard operation
PSADHealth copied to clipboard

About Test-ADServices function

Open Rapidhands opened this issue 5 years ago • 1 comments

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 avatar Dec 10 '20 13:12 Rapidhands

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

Rapidhands avatar Dec 10 '20 13:12 Rapidhands