RE: List user's mapped drives on a remote PC
- From: "Scott McWilliams" <scott.mcwilliams@xxxxxxx>
- Date: Wed, 30 Nov 2005 12:20:02 -0800
I tried your script from Windows 2003 Terminal Server against XPsp1
workstations. It didn't work. I've also tried running it from XPsp1 against
XPsp1 -once again it didn't work. It listed non-type 4 drives (floppies,
CDROMS, hard disks) on the remote PCs but not the mapped shares (type=4).
If it's working for you, I'd be interested in how our setups differ.
--
Scott McWilliams
EDS Canada
"ESP" wrote:
> 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
.
- References:
- Prev by Date: Controllers
- Next by Date: is there a way to set user enviroment from vbscript?
- 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
|
Loading