I'm trying to write a script that will audit shared folders on a few HIPAA-sensitive servers. I'm getting a list of shares just fine using
gwmi Win32_Share, however when I go to get the permissions on each share using
gwmi Win32_LogicalShareSecuritySetting, the hidden administrative shares are not listed.
I realize that's for obvious reasons, it's not like the permissions change, but I would like some kind of indication that this is in fact an administrative share. Currently I'm using a try-catch block to handle the error and kicking out a 'permissions could not be found' message.
Is there any way I can list ONLY hidden administrative shares using PowerShell?