troubleshooting Question

How to list all shared network drive and display the UNC path along its size ?

Avatar of jjoz
jjozFlag for Australia asked on
PowershellActive DirectoryWindows Server 2008
4 Comments1 Solution1477 ViewsLast Modified:


Hi All,

I am trying to enumerate the Shared Network drive in my domain using powershell, but however in my simple script below why the result is different than the the UNC path that I can just copy paste ?

so I got: \\SIMGTP01\root\CIMV2:Win32_Share.Name="Z$"
instead of: \\SIMGTP01\Z$

$strComputer = "SIMGTP01","SIMGTP02"
$colItems = get-wmiobject -class "Win32_Share" -namespace "root\CIMV2" -computername $strComputer
$colItems | Select __SERVER, __PATH, Path, Caption | ft -AutoSize

__SERVER __PATH                                                  Path                                               Caption                     
-------- ------                                                  ----                                               -------                     
SIMGTP01 \\SIMGTP01\root\CIMV2:Win32_Share.Name="Z$"             Z:\                                                Default share               
SIMGTP01 \\SIMGTP01\root\CIMV2:Win32_Share.Name="C$"             C:\                                                Default share               
SIMGTP01 \\SIMGTP01\root\CIMV2:Win32_Share.Name="Webtrends"      F:\Webtrends                                       Temp Area for Webtrends Logs
SIMGTP01 \\SIMGTP01\root\CIMV2:Win32_Share.Name="May09"          F:\SPX Restore\May09                               May09                       
SIMGTP01 \\SIMGTP01\root\CIMV2:Win32_Share.Name="Common$"        F:\Common_Backup                                   Common$
ASKER CERTIFIED SOLUTION
soostibi

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros