RE: List user's mapped drives on a remote PC
- From: ESP <ESP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 10:17:01 -0800
True, but after correcting the typo, it works 100% of the time from my Win
2003 Server.
ESP
"Scott McWilliams" wrote:
> Thanks ESP, but that does not work. When I tried your code, I first thought
> it was working but it was listing the local computer mapped drives. When I
> corrected the strcomputer/strdestination typo in the code, it yielded the
> same results as I have already found. It would list the hardware-based
> drives, but not the drives mapped by the current user of the remote XP
> computer (DriveType = 4).
>
> I understand that XP behaves differently than W2K Pro in this regard. With
> W2K Pro, all sessions on the computer see the same shares. With XP, it
> changes to a more Terminal Server-ish model where the WMI session on the
> remote computer cannot see the shares mapped in the interactive user logon
> session.
>
> I'm looking for a scripted way of enumerating the mapped drive shares in the
> interactive user session on the remote XP PC.
>
> Thanks anyway!
> --
> Scott McWilliams
> EDS Canada
>
>
> "ESP" wrote:
>
> > This is along the same lines, but should give ya what you want.
> >
> > strComputer = InputBox("Enter the machine name without '\\' ", "Machine Name")
> > If strComputer = "" Then WScript.Quit
> > Set objDrives = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> > strDestination).InstancesOf("Win32_LogicalDisk")
> > For Each INST in objDrives
> > WScript.Echo (INST.deviceid) & vbTAB & (INST.Description)
> > Next
> >
> >
> > ESP
> >
> >
> >
> >
> > "Scott McWilliams" wrote:
> >
> > > I'm trying to come up with a scripted methodology of listing the mapped
> > > drives of the current user on remote PCs. I've found an article on Technet's
> > > Hey Scripting Guys archive
> > > (http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct05/hey1027.mspx
> > > ) that describes what I want to do perfectly. I have built my script around
> > > this code, but have found that, although the article states "As usual, you
> > > can modify this script to run against a remote computer simply by assigning
> > > the name of that machine to the variable strComputer", you cannot enumerate
> > > the shares on a remote PC (XP in this case) - the response always comes back
> > > blank. The same methodology works great when run locally on the PC.
> > >
> > > How would I go about listing the mapped drives used by the current user of a
> > > remote PC?
> > >
> > > TIA
> > > --
> > > Scott McWilliams
> > > EDS Canada
.
- Follow-Ups:
- RE: List user's mapped drives on a remote PC
- From: Scott McWilliams
- RE: List user's mapped drives on a remote PC
- Prev by Date: Re: Can I compile / package up client side vbscript so an end user can't view it in a html file?
- Next by Date: MS Cluster scripting question
- Previous by thread: Re: List user's mapped drives on a remote PC
- Next by thread: RE: List user's mapped drives on a remote PC
- Index(es):
Relevant Pages
|