SharePoint Private Properties in PowerShell

Welcome to the New Year! Hope everyone is having a great start!

Now back to SharePoint… Yet Another Originated From the MSDN/TechNet Forums Question (these are always fun). So there was a question about getting the databases that belonged to a specific User Profile Service Application. All of the UPA databases for the User Profile Service Application object are marked as Internal properties, in other words, not easily accessible.

So how can we get the databases that belong to a particular UPA? First, we need to know the properties that we’re after, and for that I always use the handy .NET Reflector. The properties for the UPA Databases are:

ProfileDatabase

SocialDatabase

SynchronizationDatabase

Next, get the named User Profile Service Application in PowerShell:

Get the non-public Properties of the UPA object:

And then the non-public Property that we’re after:

This will output the Social database Name, ID, and Type!

Here is the complete script:

I hope that helps!

Leave a Reply