2

How do I get the SharePoint farm database status using below PowerShell script?

$baddb = Get-SPDatabase -id 25dfdfdf73-d941-4f66-9e92-18b19e7e5c79

It returns Name, Typd & Id but not status...

1
  • What kind of status are you expecting? Read-Only? Orphaned items? Commented Dec 5, 2016 at 9:27

1 Answer 1

2

Try this

$baddb = Get-SPDatabase -id 25dfdfdf73-d941-4f66-9e92-18b19e7e5c79

$baddb | Select Name,Status

It should show Name and online or offline status based on database status

[OutPut]

enter image description here

[Update]

Based on your comment, in this case , you will need to show NeedsUpgrade that has true or false value

EX: get all SharePoint databases name with upgrade status

Get-SPDatabase  | select Name,NeedsUpgrade

enter image description here

2
  • i tried this its not showing like in central admin page _admin/DatabaseStatus.aspx status like not responding Commented Dec 5, 2016 at 10:38
  • in this case, you need to show NeedsUpgrade column, it shows false if no action required and true if require upgrade , let me update my answer based on your comment Commented Dec 5, 2016 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.