PowerShell for Windows Admins

Mar 6 2010   6:06AM GMT

Share Type

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

 

One other point we need to cover is the type of share.  We have a number of choices as shown in the script.  The Type property has to be converted from a number to an understandable value – unless you want to learn the share types off by heart.

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
$shtyp = DATA {
ConvertFrom-StringData -StringData @’
0 = Disk Drive
1= Print Queue
2 = Device
3 = IPC
2147483648 = Disk Drive Admin
2147483649 = Print Queue Admin
2147483650 = Device Admin
2147483651= IPC Admin
‘@

}

Get-WmiObject -Class Win32_Share | 
select Name, Path, Description,
@{Name="ShareType"; Expression = {$shtyp["$($_.Type)"]}}

A calculated field can be used to derive the share type as shown.

Technorati Tags: ,,

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: