Tag Archives: Shared Folder

QuickTip: Using Win32_Share to only select non-default shares

The Win32_Share class can be used to remotely or locally gather a listed of shared folders and their properties. Since every Windows system by default has a number of standard shared folder it can be interesting to only select the non-default shares. The following line of code allows you to do that:

Get-WmiObject Win32_Share | Where-Object {(@('Remote Admin','Default share','Remote IPC') -notcontains $_.Description)}

Note that this only works for systems with English localization options. For other languages the names in the array will have to be changed to match to localized names.

Share