Hello everybody,
i Need your help.
I wrote a PowerShell monitor components. But it doesn't work. The message field Shows me only N/A.
I want to get a list of Domain Admins in our Company to reported them. It doesen't work with the variable $user, $userstr (Join HTML Codes for the reoport) and $a (want to force a String). Everytime i get for Statistic 0 and Message N/A
Import-Module ActiveDirectory
$user=@(Get-ADGroupMember -Identity 'Domain Admins' | where-object {$_.Name -like "AdminUser,*" }|Sort-Object -Property 'name' | Foreach-object {Get-ADUser -Identity $_.objectGUID -Properties Description} | ForEach-Object -Process { '{0} - ({1}) - {2}' -f $_.name,$_.SamAccountName,$_.Description })
$userstr = $user -join '<p></p>'
$test='TEST'
$a =$userstr.toString()
write-host "Statistic: 0"
write-host "Message: List $a Admins "
Exit 0;