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

Home Forums Client Operating Systems Windows 2000 Pro, XP Pro need to remotely access a (usb)drive over a network

This topic contains 14 replies, has 9 voices, and was last updated by Avatar [email protected] 1 year, 10 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • Avatar
    bw11
    Member
    #122786

    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

    Avatar
    hyeongkim
    Member
    #295865

    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 \petrik$ 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.

    Avatar
    bw11
    Member
    #295906

    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 \computerc$ and it is the same for my pc, my usb stick is given a drive letter h: but it is not automatically shared.

    cheers

    Avatar
    bw11
    Member
    #295907

    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

    Avatar
    biggles77
    Spectator
    #206452

    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.

    Avatar
    bw11
    Member
    #295908

    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?

    Avatar
    biggles77
    Spectator
    #206457

    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.

    #219333

    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.

    #219334

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

    Here ya go – it’s

    HKEY_LOCAL_MACHINESYSTEMControlSet001ServiceslanmanserverShares

    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.

    Avatar
    Rems
    Moderator
    #226294

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

    Stonelaughter wrote:
    ..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_MACHINESYSTEMControlSet001ServiceslanmanserverShares

    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_MACHINESYSTEMCurrentControlSetServicesLanmanServerShares

    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 sharesecurity 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.php?p=51554#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 = “[COLOR=”Blue”]lanmanserver[/COLOR]” ‘< — NB strService name is case sensitive!

    On Error Resume Next
    strComputer = "."
    intSleep = 5555

    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\" _
    & strComputer & "rootcimv2")

    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

    ‘____[COLOR=”blue”]BEGIN_SETTINGS[/COLOR]________________________________

    strComputer = “[COLOR=”blue”]remotecomputername[/COLOR]” ‘< — netbiosname of the target computer

    'transfer FILE:
    sFileName = "[COLOR="Blue"]restartServerService.vbs[/COLOR]"
    sSourcePath = "[COLOR="blue"]C:scripts[/COLOR]"
    sDestinationPath = "[COLOR="blue"]C$[/COLOR]" '<— through administrative share, folders must exist already!

    'job SCHEDULER:
    strWaitMinutes = [COLOR="Blue"]5[/COLOR] '<— must be a minimum of 2 minutes
    strProgram = "\"& strComputer &""& sDestinationPath &""& sFileName

    '____[COLOR="blue"]END_OFF_SETTINGS[/COLOR]________________________________

    '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}!\.rootcimv2") '<– "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 & "rootcimv2")
    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 !)

    :)

    Avatar
    bw11
    Member
    #295909

    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

    Avatar
    bryan_ch1
    Member
    #391665

    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]

    #391828

    p.s. usb drives do not have steady drive letters

    Avatar
    Ossian
    Moderator
    #191728

    Hmmm… posting in 10 year old threads…. I spell SPAAAMMMMM!

    Avatar
    mohmonem
    Member
    #391801

    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.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.