[jcifs] Remotely start windows service using java

Michael B Allen ioplex at gmail.com
Mon Sep 21 17:03:30 MDT 2009

That's an MSRPC interface. You need to find the IDL for the
StartService call, translated it into a "stub" with midlc and then use
it with DcerpcHandle.sendrecv. A good example of how to do this would
be jcifs.smb.SID.getServerSid maybe. Google for svcctl.idl and you can
probably find enough of the IDL to get started. However, MS has
probably released this information in their Windows Server Protocol
documents. That would be the definitive reference.


2009/9/21 西门烧雪 Simon <sekatsimon at gmail.com>:
> Dear all,
> I am very excited with learning the jcifs component in the past few
> days.  Made some progress and I feel it's very promising to be able to
> accomplish my task: research how to remotely start Windows Service
> using Java.
> I learned that I should be using the predefined svcctl pipe.
> The code should be something like:
> SmbNamedPipe pipe = new SmbNamedPipe( "smb://server/IPC$/PIPE/svcctl",
>        SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_CALL );
> OutputStream out = pipe.getNamedPipeOutputStream();
> InputStream in = pipe.getNamedPipeInputStream();
> I think I should the operation StartServiceW of such pipe
> (http://www.hsc.fr/ressources/articles/win_net_srv/msrpc_svcctl.html).
> I need guidance with what I should do next?  What to write to the
> outputstream which would trigger the start of, say, the server
> process?
> --
> Simon
> 西门烧雪

Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list