Page 1 of 2 12>
Topic Options
#90188 - 2002-12-03 03:41 PM remotely create mapped drive
Radimus Moderator Offline
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??
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90189 - 2002-12-03 03:54 PM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
What comes to my mind here would be rcmd , but hey we are in COM forum [Roll Eyes]
_________________________



Top
#90190 - 2002-12-03 04:00 PM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
thinking it a bit farther, I must say that you can automate the whole thing form the installation of rcmd through the unistall of it ... No COM at all, but a solution
_________________________



Top
#90191 - 2002-12-03 04:08 PM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ... well, you could wrap this thing in a kixform ?
_________________________



Top
#90192 - 2002-12-03 04:21 PM Re: remotely create mapped drive
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
You could use WMI to remotely execute a process on the target PC to 'net use' a share. Done it, yes I have.
Top
#90193 - 2002-12-03 04:24 PM Re: remotely create mapped drive
Radimus Moderator Offline
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..
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90194 - 2002-12-03 04:32 PM Re: remotely create mapped drive
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I can't answer that. I mapped a drive on a test PC, on which I was logged-on to.
Top
#90195 - 2002-12-03 04:39 PM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Rad,

how about taking this as exercise in creating a costum form asking for remote pc / drive letter / path to share having the option to remove rcmd afterwards
All with a nice and shiny User Interface ?
_________________________



Top
#90196 - 2002-12-03 06:14 PM Re: remotely create mapped drive
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
That is kind of what I'm doing...

refer to My new Project...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90197 - 2002-12-03 09:58 PM Re: remotely create mapped drive
Radimus Moderator Offline
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.

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90198 - 2002-12-03 10:36 PM Re: remotely create mapped drive
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#90199 - 2002-12-04 09:43 AM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Rad,

you might want to copy (steal) code in Bryce's excellent rcmd installer script [Big Grin]
_________________________



Top
#90200 - 2002-12-04 09:45 AM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Also there are different issues in returning errorlevels of rcmd commands :

it returns 1 only if the rcmd session was finished successfully but not the errorlevel of the command (this was to be returned with a trick i can't remember right now)
_________________________



Top
#90201 - 2002-12-05 04:30 PM Re: remotely create mapped drive
Radimus Moderator Offline
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...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90202 - 2002-12-05 04:34 PM Re: remotely create mapped drive
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and at does not work?
_________________________
!

download KiXnet

Top
#90203 - 2002-12-05 04:35 PM Re: remotely create mapped drive
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
You will need to use the Task Scheduler since it gives you the option to define a useraccount. Alternatively the Scheduler Service must be started under a local user account and not the SYSTEM account in order to gain network connectivity
_________________________
There are two types of vessels, submarines and targets.

Top
#90204 - 2002-12-05 04:36 PM Re: remotely create mapped drive
Radimus Moderator Offline
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
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90205 - 2002-12-05 04:49 PM Re: remotely create mapped drive
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
if I specify a user account, will it act upon the user's desktop
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90206 - 2002-12-05 04:54 PM Re: remotely create mapped drive
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
http://support.microsoft.com/default.aspx?scid=kb;en-us;158273

http://support.microsoft.com/default.aspx?scid=kb;en-us;158825

[ 05. December 2002, 17:06: Message edited by: Radimus ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90207 - 2002-12-05 08:51 PM Re: remotely create mapped drive
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ey Rad,

you know that you can specify an Account to run rcmd with ?

Hmmm ... maybe this won't work neither
_________________________



Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.104 seconds in which 0.035 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org