From: Kellie Fitton on
Allen,

Try to pass the machineName as a NULL, also, make sure that the user
has
shutDown privileges.

InitiateSystemShutdownEx
(NULL, gReason, gTimeout, gForce, gReboot, IReason)


Kellie.

From: Allan Bruce on

"Kellie Fitton" <KELLIEFITTON(a)YAHOO.COM> wrote in message
news:1120057155.976203.70660(a)g43g2000cwa.googlegroups.com...
> Allen,
>
> Try to pass the machineName as a NULL, also, make sure that the user
> has
> shutDown privileges.
>
> InitiateSystemShutdownEx
> (NULL, gReason, gTimeout, gForce, gReboot, IReason)
>
>
> Kellie.

If the Machine name is NULL then the local machine is shut-down, I dont want
this - I want to shut down the remote machine. Also, I believe my code
should grant the shut-down priveledge but it doesnt work.
Allan
>


From: Kellie Fitton on
Allen,

How did you define the machineName? did you use the leading slashes
"\\" or did
you use an IP address? or just called an API to get the remote
machineName.

Also, this is from the MSDN's webSite:

To shut down a remote computer, the calling thread must have the
SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer. By default,
users can enable the SE_SHUTDOWN_NAME privilege on the computer they
are
logged onto, and administrators can enable the
SE_REMOTE_SHUTDOWN_NAME privilege on remote computers."


Kellie.

From: Allan Bruce on

"Kellie Fitton" <KELLIEFITTON(a)YAHOO.COM> wrote in message
news:1120059705.903598.286870(a)g14g2000cwa.googlegroups.com...
> Allen,
>
> How did you define the machineName? did you use the leading slashes
> "\\" or did
> you use an IP address? or just called an API to get the remote
> machineName.
>
> Also, this is from the MSDN's webSite:
>
> To shut down a remote computer, the calling thread must have the
> SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer. By default,
> users can enable the SE_SHUTDOWN_NAME privilege on the computer they
> are
> logged onto, and administrators can enable the
> SE_REMOTE_SHUTDOWN_NAME privilege on remote computers."
>
>
> Kellie.
>

I have tried setting the name to "tuvok", "\\tuvok" and "192.168.0.102" and
each time I get the same error. I have read the above on msdn, but I think
the code I use gets the privilege, but I could be wrong.

Allan


From: Allan Bruce on

"Allan Bruce" <amb(a)abc.net> wrote in message
news:kLKdnRV6fOWiRFzfRVnyrA(a)pipex.net...
> Is there a way I can remotely reboot one of my machines? I have setup a
> TV server but occasionally the software serving the TV crashes and I would
> like to remotely reboot the machine. I could have remote desktop access
> to another machine on the network but would prefer to run apache and use
> it to remotely reboot.
>
> Thanks
> Allan
>

I have put the source-code in a zipfile on my web server:
http://allanbruce.redirectme.net/~allan/MachineRebooter.zip

I have it almost working - but I still get an error about the access being
denied. Is there anyone who can lend a hand on this?

Thanks,
Allan