Script or Other Method to Reboot

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi -

This shouldn't be too difficult.
I need to configure some shared machines so that regular users cannot
shutdown, but can reboot.

I can use Group Policy to Remove Shutdown from the Start Menu and Security
Box, but then I need something for the user to click on to reboot the machine
when needed.

I made a batch file using the Shutdown utility that contains the string
"shutdown -r -d p:4:1", but when a regular user tries to run they get "A
required privilege is not held by the client." Regular Users have the right
to shut down the machine and the "p:" switch is used, so I'm not sure why a
regular user can't use Shutdown in this case.

In any case, can someone show me a script or some other method to do this?

Thanks.
 
Hi,

Thanks for posting here.

From your post, my understanding of this issue is: when the users try to
run a batch file to restart the computer, they get an error message saying
"A required privilege is not held by the client". If this is not correct,
please feel free to let me know.

Actually, to restart or shutdown the computer via Shutdown command, the
user must be a member of Administrators group. If you don't want to add
the users to Administrators group, you may try to use the following script
to run the batch file:

<package>
<job id="vbs">
<script language="VBScript">
dim wshShell
set wshShell=CreateObject("Wscript.Shell")
wshShell.run("runas /u:ADMINISTRATOR a.bat")
Wscript.Sleep 100
wshShell.AppActivate "Runas"
Wscript.Sleep 300
wshShell.SendKeys "PASSWORD"
Wscript.Sleep 100
wshShell.SendKeys "~"
Wscript.Sleep 100
</script>
</job>
</package>

Note:
1. Please change ADMINISTRATOR to the administrator account on the machine
2. Please change PASSWORD to the password of the administrator account
3. Please change a.bat to the file name of your batch file

You may copy above script to a text file and save as *.wsf file in the same
folder with the batch file. After run the script, any user can restart the
computer.

Hope this helps.

Have a nice day!

Sincerely,
Tom Che
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
Thanks for the reply.

How were you able to know that only Administrators can use the Shutdown
command? I thought that maybe it was considered a remote shutdown even on
the local machine, which would explain it. But looking at the Windows Help
Center, it says the following: "Users must be granted the Shut down the
system user right to shut down either a local or remotely administered
computer using the shutdown command." Regular users do have that right on
non-servers. That seems to contadict what you're saying, but I get the
feeling you're the one who is correct.

Anyway, in your script you have given me what I wanted in that it uses Runas
to do this. The problem is that the user can read the script and see the
Administrator's password. I thought there was some way to "hide" it
VBScript. No?

I can definitely use the script if the user can't read the password.
 
Hi,

Thanks for your reply. Sorry for my delayed response due to the weekend.

We need different privileges when using Shutdown command and shutdown the
computer via menu. This is by design. I think this design may consider
that only administrator will use command to shutdown the computers. This
caused some pains indeed. It is my pleasure to help you to reflect your
recommendation to the proper department for their consideration.

Yes, if the user has sufficient knowledge and can edit the VB script, we
are not able to hide the password because it is clear text. To hide this,
we may need to compile the script. This will be a development related
request and would best be addressed in the Developer newsgroups. I have
provided the link below:

<http://msdn.microsoft.com/newsgroups/default.asp>

Or you may ask for developer support:
<http://support.microsoft.com/directory/directory/phonepro.asp?sd=msdn>

Hope this helps!

Have a nice week!

Sincerely,
Tom Che
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

That seems to contradict what you're saying, but I get the feeling you're
the one who is correct.

Anyway, in your script you have given me what I wanted in that it uses
Runas to do this. The problem is that the user can read the script and see
the Administrator's password. I thought there was some way to "hide" it
VBScript. No?

--------------------
Thread-Topic: Script or Other Method to Reboot
thread-index: AcYeKGHjXzMgxP8WSA2uGXkanJ9IUg==
X-WBNR-Posting-Host: 24.60.22.83
From: "=?Utf-8?B?Q2hhcmxpZQ==?=" <[email protected]>
References: <[email protected]>
 
OK, thanks. I'm satified with that answer.

Tom Che said:
Hi,

Thanks for your reply. Sorry for my delayed response due to the weekend.

We need different privileges when using Shutdown command and shutdown the
computer via menu. This is by design. I think this design may consider
that only administrator will use command to shutdown the computers. This
caused some pains indeed. It is my pleasure to help you to reflect your
recommendation to the proper department for their consideration.

Yes, if the user has sufficient knowledge and can edit the VB script, we
are not able to hide the password because it is clear text. To hide this,
we may need to compile the script. This will be a development related
request and would best be addressed in the Developer newsgroups. I have
provided the link below:

<http://msdn.microsoft.com/newsgroups/default.asp>

Or you may ask for developer support:
<http://support.microsoft.com/directory/directory/phonepro.asp?sd=msdn>

Hope this helps!

Have a nice week!

Sincerely,
Tom Che
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

That seems to contradict what you're saying, but I get the feeling you're
the one who is correct.

Anyway, in your script you have given me what I wanted in that it uses
Runas to do this. The problem is that the user can read the script and see
the Administrator's password. I thought there was some way to "hide" it
VBScript. No?
 
Hi,

Thanks for your reply.

If you have any other questions or concerns in future, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!

Sincerely,
Tom Che
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Thread-Topic: Script or Other Method to Reboot
thread-index: AcYgM2qRP/NRoJxuQ0+BHDQeRPPyEA==
X-WBNR-Posting-Host: 136.167.76.86
From: "=?Utf-8?B?Q2hhcmxpZQ==?=" <[email protected]>
References: <[email protected]>
<[email protected]>
 
Back
Top