Posted August 7, 20204 yr 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 Â
Create an account or sign in to comment