Hide Users from Essentials Dashboard 2011 & 2012
March 3, 2015 1 Comment
I wrote a blog post a few months back about how to use WSS PowerShell to hide Users from the Essentials 2012 R2 Dashboard. A commenter on that post asked whether or not we could do the same for 2012 R1. I know the PowerShell Support for R1 is not as rich as it is in R2, and sure enough i could not see a way to do it directly. But that just makes it more fun!
So firstly i looked around for the mechanism that Essentials R1 uses to populate the Dashboard with users. Of course it only shows users you create with the Dashboard which helped to narrow it down.
I checked through users with ADSIEdit but could not see any Essentials specific tags or values. Then i moved to the normal place Essentials stores things in the file system, the \ProgramData\Microsoft\Windows Server\Data folder.
Sure enough i found the SettingsProviderData folder, and inside here IDENTITY and USERS.
Inside this folder you will see an XML file for each user, unfortunately they are not named with any easy to recognise values, i suspect the values do mean something… to someone.
Anyway if you open one of these up you can see who the file belongs to, and crucially you will see the value <IsShowInUI>.
As you might expect, changing this value from False to True, or True to False will determine if that account appears in the dashboard or not, you will need to restart the Windows Server Identity Management Service to reflect any changes in the Dashboard.
Now, the challenge is to automate this.
In order to do this i have written a short script which you can download from here.
The script finds all the xml files in the USERS folder, and then ignores the index.xml file. It then reads the content of each remaining xml file, finds if the file contains the value <IsShowInUI>true</IsShowInUI>, if it does it attempts to identify the users name from the file.
I say ‘attempts’ as it reads the whole file as a single line of text, which with my limited skills means i have to take a guess at where the username is likely to end!
After that it offers the chance to hide this user. It then deletes the existing file, and creates a new file with the new value.
I also decided to test it on SBS Essentials 2011 and it works there as well, which is a bit of a bonus if you like that sort of thing.
I couldn’t get the script to download to the server, but I was able to manually hide the service accounts. Thank you for your help!