This has happened to me more than once. I need to force an AAD Connect sync, but can’t find the server it’s installed on. And of course it’s not been documented anywhere.
So I’ve knocked up a quick little powershell script to locate which servers on the network have AAD Connect installed. It’s not fool-proof, but it’s better than nothing.
$Servers = Get-ADComputer -Filter {OperatingSystem -Like "Windows Server*"} -Properties * | Sort name
ForEach ($Server in $Servers){
$ServerName = $Server.Name
$Path = "\$ServerNameC$Program FilesMicrosoft Azure AD Sync"
$Test = Test-Path $Path
IF ($Test -eq $true){ Write-Host "***** FOUND *****"}
Write-Host "$ServerName - $Test"
}