Sharepoint - How to get Configuration SharePoint Database Server using Power-Shell?
Select database by type, and ask for the server. Like this:
$ConfigDB = Get-SPDatabase | Where-Object{$_.Type -eq "Configuration Database"}
$ConfigDB.server
Assuming a setup close to the defaults (and that you already loaded the SharePoint snapin via asnp *sh*
), I would try this:
$server = (Get-SPDatabase | ?{$_.name -like "SharePoint_Config"})[0].Server
$server