#90188 - 2002-12-03 03:41 PM
remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'd like to be able to map a drive for a user remotely... not with a client side script.
ideas??
|
Top
|
|
|
|
#90193 - 2002-12-03 04:24 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
would you need the user's account/PW?
and it would be in the user's context?
WMI and network stuff is.. difficult..
|
Top
|
|
|
|
#90196 - 2002-12-03 06:14 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
That is kind of what I'm doing...
refer to My new Project...
|
Top
|
|
|
|
#90197 - 2002-12-03 09:58 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'm trying this, but the service isn't working...
code:
$destdir="\\$name\c$$\Winnt" copy "$tools\rcmdsvc.exe" "$destdir" shell "cmd /c $tools\xnet.exe INSTALL \\$name\Rcmd /b:C:\WINNT\rcmdsvc.EXE /u:@domain\@userid /p:$password" shell "cmd /c $tools\xnet.exe start \\$name\Rcmd" shell "cmd /c $tools\rcmd.exe \\$name net use $dl: $svrpath" shell "cmd /c $tools\xnet.exe stop \\$name\Rcmd" shell "cmd /c $tools\xnet.exe remove \\$name\Rcmd /y" del "$destdir\rcmdsvc.exe"
quote: Service installed successfully.
Starting Rcmd Request completed successfully. Error - Failed to connect to <\\wheelerc_2nd>, system not found or service not a ctive Stopping Rcmd Stopping the service failed...[1062 / service not active]
Service successfully removed.
|
Top
|
|
|
|
#90198 - 2002-12-03 10:36 PM
Re: remotely create mapped drive
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
First item is that I believe you are calling it by the wrong name. code:
running RemoteCmd Remote Command Server
{edit}
Also, I have never seen this service run as anything other than the "system" account.
when a user connects the security context of the person connecting is used, but since RemoteCmd is running as system, you will have to supply a user and paswword to connect a drive. [ 03. December 2002, 22:42: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#90201 - 2002-12-05 04:30 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
ok... after ripping Bryce's Rcmd UDF, I have it installing, executing, and uninstalling: code:
$dl="q" $svrpath="\\server\shared" $tools="\\server\logon\tools" use "\\$name\ipc$$" $targetSystemRoot = readvalue("\\$name\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\","SystemRoot") shell '%comspec% /c $tools\xnet list $target | find /i "rcmdsvc" > nul' if @error = 0 shell '%comspec% /c $tools\xnet stop \\$name\rcmdsvc > nul' shell '%comspec% /c $tools\xnet remove \\$name\rcmdsvc /y > nul' endif copy "$tools\rcmd*.exe" "\\$name\admin$$\system32" if @error <> 0 exit(@error) endif shell '%comspec% /c $tools\xnet install \\$name\rcmdsvc /b:$targetsystemroot\system32\rcmdsvc.exe /n:"Remote Command Service" /u:localsystem /i:y /s:auto > nul' shell '%comspec% /c $tools\xnet start \\$name\rcmdsvc > nul' shell '%comspec% /c $tools\rcmd.exe \\$name net use $dl: $svrpath' shell '%comspec% /c $tools\xnet stop \\$name\rcmdsvc > nul' shell '%comspec% /c $tools\xnet remove \\$name\rcmdsvc /y > nul' del "$destdir\rcmdsvc.exe" use "$target\ipc$$" /delete
However, the system account cannot access the network.
I have tried to use SOON.EXE to schedule a Job code:
C:\>soon \\client 61 /interactive "cmd /c net use q: \\server\shared"
With the same result.
Any Ideas...
|
Top
|
|
|
|
#90204 - 2002-12-05 04:36 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
it functions... But the security context cannot access the network.
BTW, Soon is a reskit wrapper for AT. Just to make 'quickie' tasks
|
Top
|
|
|
|
#90205 - 2002-12-05 04:49 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
if I specify a user account, will it act upon the user's desktop
|
Top
|
|
|
|
#90206 - 2002-12-05 04:54 PM
Re: remotely create mapped drive
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 382 anonymous users online.
|
|
|