ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Find Source of Windows Mapped Drives

    Scheduled Pinned Locked Moved IT Discussion
    windowsstoragemapped drivenetwork file systemsmb
    21 Posts 5 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch @scottalanmiller
      last edited by

      @scottalanmiller Again, this does you likely no good, as the admin session likely has nothing mapped in the first place. but it does run as it should.

      scottalanmillerS M 2 Replies Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @JaredBusch
        last edited by

        @jaredbusch said in Find Source of Windows Mapped Drives:

        @scottalanmiller Again, this does you likely no good, as the admin session likely has nothing mapped in the first place. but it does run as it should.

        I don't see where you ran this..

        Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=4" | ForEach-Object { Write-Host ("{0} {1}" -f ($_.DeviceID), ($_.ProviderName)) }
        
        JaredBuschJ 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @scottalanmiller
          last edited by JaredBusch

          @scottalanmiller said in Find Source of Windows Mapped Drives:

          @jaredbusch said in Find Source of Windows Mapped Drives:

          @scottalanmiller Again, this does you likely no good, as the admin session likely has nothing mapped in the first place. but it does run as it should.

          I don't see where you ran this..

          Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=4" | ForEach-Object { Write-Host ("{0} {1}" -f ($_.DeviceID), ($_.ProviderName)) }
          

          bottom of the second screen shot..

          I copied it right from this thread and ran it.

          First without the foreach and then the full command.

          1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch
            last edited by

            sequence:

            • net use to show nothing mapped.
            • net use s: \\fsldc02\software to map an S drive
            • net use to show mapping.
            • Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=4" with the approriate #!ps prefix for ScreenConnect
            • Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=4" | ForEach-Object { Write-Host ("{0} {1}" -f ($_.DeviceID), ($_.ProviderName)) } with the approriate #!ps prefix.
            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • M
              manxam @JaredBusch
              last edited by manxam

              @jaredbusch said in Find Source of Windows Mapped Drives:

              @scottalanmiller Again, this does you likely no good, as the admin session likely has nothing mapped in the first place. but it does run as it should.

              @JaredBusch and @scottalanmiller and this is where my original comment came in about admin account. Most RMM tools run under elevated privileges and, therefore, return no data as they're not running under the user context. One could, however, likely do a "Start-Process powershell.exe -Credential "domain\user"" before the wmic command but it gets awfully complicated at that point.

              JaredBuschJ 1 Reply Last reply Reply Quote 2
              • JaredBuschJ
                JaredBusch @manxam
                last edited by JaredBusch

                @manxam said in Find Source of Windows Mapped Drives:

                @jaredbusch said in Find Source of Windows Mapped Drives:

                @scottalanmiller Again, this does you likely no good, as the admin session likely has nothing mapped in the first place. but it does run as it should.

                @JaredBusch and @scottalanmiller and this is where my original comment came in about admin account. Most RMM tools run under elevated privileges and, therefore, return no data as they're not running under the user context. One could, however, likely do a "Start-Process powershell.exe -Credential "domain\user"" before the wmic command but it gets awfully complicated at that point.

                Yes, you are right, but I was just correcting the statement that it would not run from ScreenConnect.

                M 1 Reply Last reply Reply Quote 0
                • M
                  manxam @JaredBusch
                  last edited by manxam

                  @jaredbusch, totally understood. I wasn't claiming otherwise. I just wanted to vocalize it for others who jump into the thread.
                  Thanks for the verification.

                  1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @JaredBusch
                    last edited by

                    @jaredbusch said in Find Source of Windows Mapped Drives:

                    • Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=4" | ForEach-Object { Write-Host ("{0} {1}" -f ($_.DeviceID), ($_.ProviderName)) } with the approriate #!ps prefix.

                    I've not used that before. I use @powershell and that normally works but did not work here.

                    JaredBuschJ 1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch @scottalanmiller
                      last edited by JaredBusch

                      @scottalanmiller said in Find Source of Windows Mapped Drives:

                      @jaredbusch said in Find Source of Windows Mapped Drives:

                      • Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=4" | ForEach-Object { Write-Host ("{0} {1}" -f ($_.DeviceID), ($_.ProviderName)) } with the approriate #!ps prefix.

                      I've not used that before. I use @powershell and that normally works but did not work here.

                      That is the proper way to run powershell from ScreenConnect.

                      So what you were doing was launch powershell from a command prompt session.

                      Doing @powershell, you probably need to handle escaping quotes or something is all.

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @JaredBusch
                        last edited by

                        @jaredbusch said in Find Source of Windows Mapped Drives:

                        Doing @powershell, you probably need to handle escaping quotes or something is all.

                        Likely

                        JaredBuschJ 1 Reply Last reply Reply Quote 0
                        • JaredBuschJ
                          JaredBusch @scottalanmiller
                          last edited by

                          @scottalanmiller said in Find Source of Windows Mapped Drives:

                          @jaredbusch said in Find Source of Windows Mapped Drives:

                          Doing @powershell, you probably need to handle escaping quotes or something is all.

                          Likely

                          https://docs.connectwise.com/ConnectWise_Control_Documentation/Get_started/Host_page/Run_a_command_from_the_Host_page#Use_Powershell

                          1 Reply Last reply Reply Quote 1
                          • 1
                          • 2
                          • 1 / 2
                          • First post
                            Last post