Quantcast
Channel: QuickTip – Jaap Brasser's Blog
Viewing all articles
Browse latest Browse all 18

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

$
0
0

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}

Viewing all articles
Browse latest Browse all 18

Trending Articles