7

I have X number of database servers on the farm , I need to know

Which database server have the SharePoint Configuration Database using Power-Shell ?

I know I can get Which server via Central Administration by Navigating to

System Settings > Servers on Farm

But I need to get SharePoint Configuration Database server via Power Shell ,

Is there a cmdlet to achieve that ?

Thanks !

7

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
9

Select database by type, and ask for the server. Like this:

$ConfigDB = Get-SPDatabase | Where-Object{$_.Type -eq "Configuration Database"}
$ConfigDB.server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.