#25685 - 2002-07-23 07:40 PM
Re: getting user id from mapped drive
|
maciep
Korg Regular
   
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
As my luck would go, it works just fine on every mapping I've tried...except the one i need. When I check the status of the mapping with WMI, it comes back with "Error", even though I can open the drive and browse. Not quite sure what "Error" is telling me.
Here's the snippet of code I'm working with:
code:
$DiskSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_NetworkConnection")
For each $Disk in $DiskSet ? "Drive: " + $Disk.RemoteName + ", " + "Status: " + $Disk.Status + ", " + "User Name: " + $Disk.UserName Next
********************OUTPUT*********************
Drive: \\1upmc-sam-001\e$, Status: Degraded, User Name: 1UPMC-ACCT\maciep Drive: \\new-emanage1\c$, Status: Degraded, User Name: 1UPMC-ACCT\maciep Drive: \\1upmc-aisrv1\c$, Status: Degraded, User Name: 1UPMC-ACCT\maciep Drive: \\1upmc-aisrv2\c$, Status: Degraded, User Name: 1UPMC-ACCT\maciep Drive: \\1upmc-aisrv3\c$, Status: Degraded, User Name: 1UPMC-ACCT\maciep Drive: \\desktop-02\dfs, Status: Error, User Name:
I have the people who own the share (and know a lot more than I do) thinking about it. Has anyone ever tried this, and if so, come across this problem?
_________________________
Eric
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2175 anonymous users online.
|
|
|