+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 27
Windows Thread, Shutdown/Restart Script - Access Denied (5) in Technical; My shutdown script (shutdown /s /f /t 0 /m \pcname) which has worked fine for many years has just today ...
  1. #1

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217

    Shutdown/Restart Script - Access Denied (5)

    My shutdown script (shutdown /s /f /t 0 /m \\pcname) which has worked fine for many years has just today decided to fail. It displays Access is Denied (5).

    Is anyone aware of any recent MS patches or anything that affect RPC?

    Thanks

    Chris

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Could the account you're using to do this have been removed from local admins on the remote machine? Could the machine have lost its AD account?

    If you go to the machine can you log on locally and shut it down? Anything in event log?

    Is this just a one-off or is it all the time? (If the server service stopped for some reason you wouldn't be able to make an RPC connection but it ought to just start at the next reboot)

  3. #3

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217
    Hi Steve,

    I have been looking into security/permissions but found nothing. I have checked all groups and individual security and it all seems fine and unchanged from when it was working only last week. All services seem to be running fine too. I retested as my own account (domain admin) and then again with the buitin administrator account and got the same error. I have tested from the PDC to the PC and from my non domain laptop (with an authenticated session) to the PC and found the same issue.

    Windows firewall is disabled (I checked) but sophos firewall is active but not reporting any blocks.

    The only thing I have yet to test is running it localy (will try it next week).

    Thanks

    Chris

    EDIT - This is on all the PCs in one ICT suite and has happened to them all at the same time, hence why i think its an update or similar.
    Last edited by CHR1S; 3rd April 2009 at 04:04 PM. Reason: added extra info

  4. #4

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217
    I can use shutdown script local on each PC, I have manually (re)added the admin user groups and such on each PC but still get the same error message.

    I have a feeling the solution is staring me in the face but it will be the death of me lol!

  5. #5

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217
    Ok, so im starting to think its permissions issues. I have compared a working PC to a non and there are no differences in users and groups.

    Can anyone tell me what user account is used for RPC calls?

    Thanks

  6. #6
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,541
    Thank Post
    362
    Thanked 263 Times in 215 Posts
    Rep Power
    100
    I have a shutdown script that probably does the same thing in the same way, the only time ive ever had any access denied issues is when the time was set wrong in the bios/windows, try checking the time settings on the PCs

    Afraid that is all i can suggest

  7. Thanks to mrbios from:

    KevWCFE (4th November 2011)

  8. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,807
    Thank Post
    3,320
    Thanked 1,056 Times in 977 Posts
    Rep Power
    365
    disable the sophos firewall and try again, if not there should hopefully be events in event viewer with errors or something along those lines so report back with any errors if there are any

  9. #8


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 434 Times in 353 Posts
    Rep Power
    126
    Might be worth trying PSShurdown instead, should be relatively easy to change your script.

  10. Thanks to K.C.Leblanc from:

    CHR1S (21st April 2009)

  11. #9
    BJG
    BJG is offline
    BJG's Avatar
    Join Date
    May 2008
    Location
    Norwich
    Posts
    465
    Thank Post
    89
    Thanked 35 Times in 25 Posts
    Rep Power
    22
    Could try killing all non-essential processes on the client beforehand to see if something's interfering with it.

  12. Thanks to BJG from:

    CHR1S (21st April 2009)

  13. #10

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217
    Thanks for the tips guys, I have rulled out sophos, the firewall part isnt even installed. I have already checked the event viewers and found nothing.

    Will give PSShutdown a go.

  14. #11

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217
    Right, hope someone out there is still reading this... finally got some time to look into this further.

    Went to drop the psshutdown.exe into the \\PCName\c$ and I get Access Denied. I can connect to the server just not to the ICT Suite PCs. It prompts me for a username and password but no combination works, not even admin prefixed with the domain name.

    This all has to be related... what am I missing?

    Thanks

    Chris

  15. #12

    CHR1S's Avatar
    Join Date
    Feb 2006
    Location
    Birmingham
    Posts
    4,505
    Thank Post
    1,585
    Thanked 486 Times in 304 Posts
    Rep Power
    217
    Ahaaaaaa, wooooo I've fixed it!!!

    Deep in AD a rouge policy where it added a specific user to remote desktop was overwriting the existing users instead of adding to them -
    Computer Config - Windows Settings - Security Settings - Local Policies - User Rights Assignment - Access the computer from the network.

    Grr all that for one wrong user account in the wrong place.

  16. #13

    Join Date
    Jun 2009
    Location
    Manchester, UK
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    remote shutdown - access denied (5)

    Hi Chr1s,
    I had exactly the same problem this morning, could'nt figure out why I was getting the access denied (5) message with the shudown command.

    But I tried using the TSSHUTDN command and that worked fine!

    TSSHUTDN /? for command syntax

    Hope this helps

  17. #14
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,541
    Thank Post
    362
    Thanked 263 Times in 215 Posts
    Rep Power
    100
    Very simple but it has'nt been mentioned, have you checked the computers time? if the time is more than like 5 minutes out of the correct time it'll give you that exact problem

  18. #15

    Join Date
    Apr 2010
    Location
    Los Angeles
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    This is actually very simple to fixed, just RDP to the remote computer firts and click>start>run and type secpol.msc>expand local policies>user rights assigment>add the account that you are using to force shutdown from a remote system policy, for example your personal account.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Accesss Denied Error VBS Login Script
    By kiran in forum Windows Vista
    Replies: 4
    Last Post: 11th September 2008, 09:38 PM
  2. Restart when script completes
    By djones in forum Scripts
    Replies: 4
    Last Post: 18th May 2008, 10:26 PM
  3. Access Denied from Admin Network
    By MrDylan in forum ICT KS3 SATS Tests
    Replies: 9
    Last Post: 25th April 2006, 12:09 PM
  4. Remotely Shutdown/Restart PC's at night
    By flyinghaggis in forum How do you do....it?
    Replies: 20
    Last Post: 2nd February 2006, 09:28 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •