microsoft/CSS-Exchange

[Work Item] HealthChecker + HybridAgent

Open

#2,005 建立於 2024年2月16日

在 GitHub 查看
 (2 留言) (0 反應) (1 負責人)PowerShell (234 fork)batch import
Health CheckerP2TriageWork Itemhelp wanted

倉庫指標

Star
 (985 star)
PR 合併指標
 (平均合併 4天 12小時) (30 天內合併 12 個 PR)

描述

Describe the work Trying to add functionality to check for Hybrid Agent usage in Exchange Hybrid scenario.

Additional Context So far it seems we have a few ways to check this: (Credit to Dylan Stetts) $Servers = Get-ExchangeServer | ? {$_.ServerRole -notlike "Edge"} $array = @() foreach($server in $servers) { # Installed Programs location $UninstallKey=”SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”

# Create an instance of the Registry Object and open the HKLM 
$reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey(‘LocalMachine’,$server.name) 

# Open subkeys for uninstalled programs
$regkey=$reg.OpenSubKey($UninstallKey) 

# Retrieve an array of string that contain all the subkey names
$subkeys=$regkey.GetSubKeyNames() 

# Open each Subkey and use GetValue Method & map server name & Key name
foreach($key in $subkeys){
    $thisKey=$UninstallKey+”\\”+$key 
    $thisSubKey=$reg.OpenSubKey($thisKey) 
    $obj = New-Object PSObject
    $obj | Add-Member -MemberType NoteProperty -Name “ExchangeServer” -Value $server.Name
    $obj | Add-Member -MemberType NoteProperty -Name “DisplayName” -Value $($thisSubKey.GetValue(“DisplayName”))
    $array += $obj
} 

}

$array | ? { $_.DisplayName -like "Hybrid Service"} | select ExchangeServer, DisplayName

According to our documentation we can also check this file path where the HybridAgent has been installed: *\Program Files\Microsoft Hybrid Service* https://learn.microsoft.com/en-us/exchange/hybrid-deployment/hybrid-agent#option-2-get-status-via-the-hybrid-management-powershell-module

貢獻者指南