I am trying to reboot my server (part of another thread), but had a question thought could stand on it's own. I have a batch reboot bat file that uses psshutdown.exe to reboot the server.
If I run the batch file on my computer thru a standard dos window it returns access denied.
If I run the batch file from a dos windows that I selected open as Administrator, it reboots instantly.
When I call the script what is nrpe using for the account that is running the bat file. I am not seeing it function and thinking permissions to complete the task may be an issue.
Thanks.
JR
who does NSClient++ run scripts as?
Re: who does NSClient++ run scripts as?
By default, I believe NSCLIENT runs as Local System
http://docs.nsclient.org/tutorial/core/ ... g-nsclient
http://docs.nsclient.org/tutorial/core/ ... g-nsclient
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: who does NSClient++ run scripts as?
Thanks, so even though my account is an admin (domain admin) of the box, it still requires open as admin to be selected in order to reboot from a bat file. If I set the service to run as my admin account will it work considering the above, or do I physically have to have NSClient++ run as local admin? Being a domain controller local admin is probably disabled. Thanks.
Note tried running "C:\Program Files\NSClient++\nscp.exe" test
without run as admin and gave all kinds of errors. When I opened a dos windows "as admin" and ran it came up waiting for command.
Sent a "reboot" which is the name of the script and rebooted the computer but guessing that's because of the way I manually called NSClient.
Thoughts?
JR
Note tried running "C:\Program Files\NSClient++\nscp.exe" test
without run as admin and gave all kinds of errors. When I opened a dos windows "as admin" and ran it came up waiting for command.
Sent a "reboot" which is the name of the script and rebooted the computer but guessing that's because of the way I manually called NSClient.
Thoughts?
JR
Re: who does NSClient++ run scripts as?
I believe this falls into the windows security settings. The service does indeed run as local system, as @bwallace mentioned. I am not having the same issue you are as I try to replicate, but I do have local admin. I suspect your domain admins group might not have the right permissions.
Under a normal eleveated prompt (not admin), I am seeing the following result (last few lines) -
From here, I can run any check command I otherwise would without an issue.
In your environment, can you post the output of this command ran in powershell?
Under a normal eleveated prompt (not admin), I am seeing the following result (last few lines) -
Code: Select all
D core NSClient++ - 0.4.4.15 2015-11-25 Started!
D core C:\Program Files\NSClient++/modules\CommandClient.dll.dll
D core adding C:\Program Files\NSClient++/modules\CommandClient.dll
D core Loading plugin: CommandClient.dll...
D cli Enter command to execute, help for help or exit to exit...
In your environment, can you post the output of this command ran in powershell?
Code: Select all
get-acl -path 'C:\Program Files\NSClient++\' | format-list
We do like to keep topics contained to one issue, so please try to keep this specifically to your question, and the reboot script separate.When I call the script what is nrpe using for the account that is running the bat file. I am not seeing it function and thinking permissions to complete the task may be an issue.
Former Nagios Employee