Jump to content

Look at local users mapped drives without bugging them


Recommended Posts

Ok this guy will display the users mapped drive of the user thats logged into the pc as well as the status of the drive, disconnected, Ok, ect...  Nice if you's setting up another pc remotely and you want to see what the shared drives on another users pc were so you can match them.


#by eDecisions

$Taskname = "netuse"
$lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser")

SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $Taskname /RU $lastlogon /TR "c:\maplist.bat"
start-sleep -s 1

New-Item c:\maplist.bat -ItemType "file"
Set-Content c:\maplist.bat 'net use >> c:\maplist.txt'

schtasks /Run /TN $Taskname
start-sleep -s 1
schtasks /delete /tn $Taskname /f

get-content -path c:\maplist.txt

del c:\maplist.txt
del c:\maplist.bat


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...