QuickTip: Using Win32_Share to select non-default shares using Type property

Because default administrative shares might have been renamed or have their descriptions alternated, the following method can also be used to select non-administrative shares:

Get-WmiObject -Query "select * from Win32_Share where type='<span style="color: #555555;">0</span>'"

This query will return only shares of disk drives that are not administrative shares. Alternatively the same can be accomplished by using the pipeline in combination with Where-Object:

Get-WmiObject -Class Win32_Share | Where-Object {$_.Type -eq 0}
Share

Leave a Reply

Your email address will not be published.