Announcement

Collapse
No announcement yet.

need to remotely access a (usb)drive over a network

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • need to remotely access a (usb)drive over a network

    Hi All,

    I have a user on my network who is using a usb drive. I would like to be able to access the contents of this drive accross the network.

    We are both using wxp sp2, I am logged on as an administrator (with domain admin rights) and can remotely connect to the user's machine using computer management mmc and see whether the user has the usb drive connected (under storage then disk management). I can right click on the disk and then go to properties and volumes, selected the drive, but then cannot click on 'properties' as it is greyed out. I want to be able to go into here to share the drive.

    Can anyone help? or is there another way to remotely enable an administrative share on a removable disk? I can't really do it locally to the machine unless i do it out of hours (when the usb disk will not be there) as we are auditing this user.

    We have a win server 2k3 network with group policy if that is any help.

    Thanks,
    Bw11

  • #2
    Re: need to remotely access a (usb)drive over a network

    I am assuming the user's machine is on your domain.
    I am assuming the USB drive has drive letter.
    I am assuming the machine is still online
    I am assuming the USB drive's power is on and connected to the user's machine.

    For example, if the user's computer name is petri and the drive has drive letter k:

    from your machine, type \\petri\k$ that will give you the full access, so try it.

    If the user was local admin the user can take out access permission, in that case you need to override the permission. So let me know if that works if not I have to post another reply.
    MCP, MCSA+messaging, MCDBA, OCA.

    Comment


    • #3
      Re: need to remotely access a (usb)drive over a network

      Hi,

      thanks a lot for replying so quickly, all of your assumptions are correct, but unfortunately i can't do that as the drive is not shared.

      I can connect that way to the c: drive as this has a default admin share for \\computer\c$ and it is the same for my pc, my usb stick is given a drive letter h: but it is not automatically shared.

      cheers
      Last edited by bw11; 21st March 2007, 10:30.

      Comment


      • #4
        Re: need to remotely access a (usb)drive over a network

        btw, the user has no admin rights. As administrator my user account is in the local admin group for the machine, but i still cannot share the drive remotely

        thanks

        bw11

        Comment


        • #5
          Re: need to remotely access a (usb)drive over a network

          If this is a covert audit, drop into his machine using RDP to share the drive when he is, off for coffee, water cooler networking, out to lunch, emptying lunch, arrange for his supervisor or manager to talk to him away from his machine for 15 to 20 minutes.
          1 1 was a racehorse.
          2 2 was 1 2.
          1 1 1 1 race 1 day,
          2 2 1 1 2

          Comment


          • #6
            Re: need to remotely access a (usb)drive over a network

            The user never really leaves the machine unlocked, and when they are not there they take the usb drive. can i RDP without logging them off?

            I just thought that there must be a way to enable sharing the drive remotely or maybe have it as default to share these drives when they are connected. perhaps under a group policy?
            Last edited by bw11; 21st March 2007, 15:31.

            Comment


            • #7
              Re: need to remotely access a (usb)drive over a network

              RDP opens up a seperate session. Best not to do it while they are at the machine as there are indications that something is happening.

              It they go out for lunch and take their USB with them, insert your own flash drive while they are gone, RDP and share it so when they come back and plug theirs in the SHARE may still be working. (Oh yes, if you do that, don't forget to remove your USB unit before they return). Never tried it so it may not work, but you can try it on a couple of other machines.

              Be aware of the Privacy laws of your country because what you are trying to do may be illegal where you are. If you suspect the user is using his USB drive for suspect purposes, lock the USB ports down. Also make sure you have a Security Policy that all users have signed and know that violation of the policy can result in dismissal.
              1 1 was a racehorse.
              2 2 was 1 2.
              1 1 1 1 race 1 day,
              2 2 1 1 2

              Comment


              • #8
                Re: need to remotely access a (usb)drive over a network

                I can't remember where it is but there is a registry key which lists the shares on a computer. You can add things to this list even when the referenced drive is not present, and you can access this registry key using regedit on your own machine.

                All you have to do is add a value to the list for the K: drive in the same format as the other values and when he plugs it in it will be shared...

                If he has no other shares on his workstation, share something on yours to get the format for the registry value.


                Tom
                For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

                Anything you say will be misquoted and used against you

                Comment


                • #9
                  Re: need to remotely access a (usb)drive over a network

                  Here ya go - it's

                  HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\l anmanserver\Shares

                  Value name is the Share Name

                  Value data is as follows:
                  CSCFlags=0
                  MaxUses=4294967295
                  Path=D:\Shared
                  Permissions=0
                  Remark=
                  Type=0


                  "Permissions" is 0 for "Everyone...Full Control". Don't forget that that is SHARE permissions.


                  Tom
                  For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

                  Anything you say will be misquoted and used against you

                  Comment


                  • #10
                    Re: need to remotely access a (usb)drive over a network

                    Originally posted by Stonelaughter

                    ..there is a registry key which lists the shares on a computer. You can add things to this list even when the referenced drive is not present, and you can access this registry key using regedit on your own machine.

                    All you have to do is add a value to the list for the K: drive in the same format as the other values and when he plugs it in it will be shared...

                    If he has no other shares on his workstation, share something on yours to get the format for the registry value.
                    __________________________________________________ _________

                    Here ya go - it's

                    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\l anmanserver\Shares

                    Value name is the Share Name

                    Value data is as follows:
                    CSCFlags=0
                    MaxUses=4294967295
                    Path=D:\Shared
                    Permissions=0
                    Remark=
                    Type=0


                    "Permissions" is 0 for "Everyone...Full Control". Don't forget that that is SHARE permissions.
                    the correct key is;
                    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
                    <REG_MULTI_SZ>
                    CSCFlags=0
                    MaxUses=4294967295
                    Path=H:\
                    Permissions=0
                    Remark=Shared USB
                    ShareName=USBdrive
                    Type=0

                    There is still one problem when adding the sharename through registry that is you have to Stop/Start the ' lanmanserver' service to make the changes effective without the need to reboot the computer.
                    You can not restart that particular service from remote, because you will lose connection the moment the service is stopped. Then there is no way you can reconnect to that remote computer again. So you are not able to start the service!

                    But first create the values in the right Type with regedit, the way Stonelaughter described.
                    Then create on you own computer a share and set the permissions you also want for the USB drive. Then you can copy the permissions from the share\security subkey from your computer and past that in the value in the same subkey on the remote computer.

                    The only thing that is left to do is to restart that service.
                    You can to do that by using 2 vbscripts.
                    - one script is copying the other script to the remote computer
                    and at the same time create a job in the tasksheduler on the remote computer to run that other script w/in a few minutes.
                    - The other script, runned from the remote machine it self, can stop and start the lanmanserver service.
                    or, An other option is to remotely reboot the other computer, but the user will, of course notice that.

                    Be aware that USB drives do not have steady drive letters!
                    (What you can do, is to map a subsitute driveletter [B:] as extra to the Drive-ID Then share the subsitude driveletter instead. But then you need to run a script on the other computer every time the usb-drive is fresh plugged-in to substitude the driveletter,
                    http://forums.petri.com/showthread.p...1554#post51554 (option 3))





                    Here are the scripts:

                    Script that Stop&&Start the lanmanserver service,
                    this script ("restartServerService.vbs") will be copied to the other computer
                    Code:
                    '  http://forums.petri.com/showthread.php?t=14643
                    
                    Option Explicit
                    Dim objWMIService, objItem, objService
                    Dim colListOfServices, strComputer, strService, intSleep
                    
                    
                    strService = "lanmanserver"  '<--- NB strService name is case sensitive!
                    
                    
                    On Error Resume Next
                    strComputer = "."
                    intSleep = 5555
                    
                    Set objWMIService = GetObject("winmgmts:" _
                                        & "{impersonationLevel=impersonate}!\\" _
                                        & strComputer & "\root\cimv2")
                    
                    Set colListOfServices = objWMIService.ExecQuery _
                                      ("Select * from Win32_Service Where Name = '"_
                                      & strService & "'")
                    
                        For Each objService in colListOfServices
                            objService.StopService()
                            WSCript.Sleep intSleep
                            objService.StartService()
                        Next 
                    
                    WScript.Quit

                    And next is the script that must be executed from your computer,
                    it will first copy the other script from your computer to the other computer
                    then it will schedule the job to launch the other script from/on the other computer
                    Code:
                    '  http://forums.petri.com/showthread.php?t=14643
                    
                    '____BEGIN_SETTINGS________________________________
                    
                    
                      strComputer      = "remotecomputername"  '<--- netbiosname of the target computer
                    
                    'transfer FILE:
                      sFileName        = "restartServerService.vbs"
                      sSourcePath      = "C:\scripts\"
                      sDestinationPath = "C$\"             '<--- through administrative share, folders must exist already!
                    
                    
                    'job SCHEDULER: 
                      strWaitMinutes = 5  '<--- must be a minimum of 2 minutes
                      strProgram     = "\\"& strComputer &"\"& sDestinationPath &"\"& sFileName
                    
                    '____END_OFF_SETTINGS________________________________
                    
                    
                    
                    'do file transfer
                    '-----------------------------------------------------------
                    Const OverwriteExisting = TRUE
                    Set objFSO = CreateObject("Scripting.FileSystemObject")
                    objFSO.CopyFile sSourcePath &"\"& sFileName, _
                        "\\"& strComputer &"\"& sDestinationPath &"\", OverWriteExisting
                    
                    
                    'create and activate scheduler Job (for today and only run once)
                    '-----------------------------------------------------------
                    ' - http://www.microsoft.com/technet/scriptcenter/guide/sas_man_rsxs.mspx?mfr=true
                    ' - http://msdn2.microsoft.com/en-us/library/aa394601.aspx
                    
                    Set objSWbemServices = GetObject("winmgmts:" _
                      & "{impersonationLevel=impersonate}!\\.\root\cimv2")  '<-- "localhost" !
                    
                    Set colComputer = objSWbemServices.ExecQuery _
                      ("SELECT CurrentTimeZone FROM Win32_ComputerSystem")
                    
                      For Each objComputer in colComputer
                        dlsBias = objComputer.CurrentTimeZone
                      Next
                    
                    If Int(instr(Cstr(dlsBias),"-"))=1 Then a="-" Else a="+"
                    dlsBias = a & Right(1000 + Abs(dlsBias),3)
                    
                    
                    Set objWMIService = GetObject("winmgmts:" _
                     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
                    Set colItems = objWMIService.ExecQuery("Select * from Win32_LocalTime")
                    
                    For Each objItem in colItems
                      strtTime = replace(FormatDateTime(DateAdd("n", strWaitMinutes, _
                                 Right(100+objItem.Hour,2)&":"&Right(100+objItem.Minute,2) _
                                 ),4),":","")
                      Exit For
                    Next
                    
                    sScheduled = "********" & Right(10000 + strtTime,4) _
                                 & "00.000000" & dlsBias
                    
                    
                    Set objService = GetObject("winmgmts:\\" & strComputer)
                    Set objNewJob = objService.Get("Win32_ScheduledJob")
                    
                    errJobCreated = objNewJob.Create _
                     ("wscript.exe " & chr(34) & strProgram & chr(34), sScheduled, , , , True, JobID)
                    
                    
                    If Err.Number = 0 Then
                     Wscript.Echo "New Job ID: " & JobID
                    Else
                     Wscript.Echo "An error occurred: " & errJobCreated
                    End If
                    \Rems



                    -------------------------------------------------------
                    - EDIT - EDIT - EDIT :
                    -------------------------------------------------------

                    After some further investigation, I found out two things about the the second listed script above (=the script that must be runned from your computer).

                    Here the value of "Bias" what is neede to remotely set the schedule the job,
                    must be counting for the computer on which the job initiating script is executed from (that will be your computer)! not for the remote computer.
                    You can set that value automatically,
                    there for I REPLACED the line:

                    BiasGMT = "+060" '<-- +plus or -minus the amount of minutes (in 3-charactters) between the computers actual DayLightSavings-time and GMT (so do not just use the standard Time-zone here)

                    ~ (...done !)


                    And the other thing is the 'hours minutes' that will be added to the scheduledJob, they must be corresponding with the current time on Target computer.
                    There for I had to replace the lines:

                    sScheduled = "********" & _
                    replace(FormatDateTime(DateAdd("n", _
                    strWaitMinutes,now()),vbshorttime),":","") _
                    & "00.000000" & BiasGMT


                    ~ (...done !)

                    Last edited by Rems; 11th May 2007, 11:30. Reason: more about remote jobscheduler

                    This posting is provided "AS IS" with no warranties, and confers no rights.

                    __________________

                    ** Remember to give credit where credit's due **
                    and leave Reputation Points for meaningful posts

                    Comment


                    • #11
                      Re: need to remotely access a (usb)drive over a network

                      sorry i didn't reply earlier, but thank you all very much for your help guys, I succeeded in doing what i wanted.

                      cheers,
                      bw11

                      Comment


                      • #12
                        Hi!
                        I found interesting article about accessing USB devices over Internet. I think it could be helpful for people who are looking for easy solution to use their USB devices remotely. Here is [MOD EDIT DELETED LINK]

                        [MOD EDIT]
                        When will these f***wits realise that joining up purely to post a commercial link on a 10 year old thread is bound to be spotted as spamming and will result in the inevitable BAN. So, TobyBar, you are BARRED
                        [/MOD EDIT]
                        Last edited by Ossian; 16th January 2017, 16:58.

                        Comment


                        • #13
                          p.s. usb drives do not have steady drive letters

                          Comment


                          • #14
                            Hmmm... posting in 10 year old threads.... I spell SPAAAMMMMM!
                            Tom Jones
                            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
                            PhD, MSc, FIAP, MIITT
                            IT Trainer / Consultant
                            Ossian Ltd
                            Scotland

                            ** Remember to give credit where credit is due and leave reputation points where appropriate **

                            Comment


                            • #15
                              You can access USB drive data remotely as follows: Plug USB drive in computer. From other computer use tools like on premise R-HUB remote support servers, logmein etc. and access this USB drive computer. You will get a removable disk drive. Double clicking on the same, you will get all USB drive data remotely.

                              Comment

                              Working...
                              X