Hi @Suthar, Anil ,
Let's give it another try please:
$ScriptPath = Get-Location
Get-ADComputer -Filter {(OperatingSystem -like "windows*server") -and (Enabled -eq "True")} -Properties * | SORT Name | Select -ExpandProperty Name | Out-File $ScriptPath\ServerListNames.txt
Get-ADComputer -Server <yourDC of anil.abc.com> -Filter {(OperatingSystem -like "windows*server") -and (Enabled -eq "True")} -Properties * | SORT Name | Select -ExpandProperty Name | Out-File $ScriptPath\ServerListNames.txt -Append
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten