Results 1 to 8 of 8

Thread: [RESOLVED] Workaround for Shutdown.exe LUA bug

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Resolved [RESOLVED] Workaround for Shutdown.exe LUA bug

    I'm trying to create a code that does the following automatically.

    How to do it (requires admin privileges): Open Administrative Tools \ "Local Security Settings". Navigate to Security Settings \ Local Policies \ User Rights Assignment. Double-click "Force shutdown from a remote system" in the right pane. Click "Add User or Group". Enter the name INTERACTIVE in the text box and click "Check names", then click OK, and OK again.

    Taken from: http://blogs.msdn.com/aaron_margosis...27/518214.aspx

    I have administrative rights on the computer, but i wish to create code that does that automatically. I have no idea what to search for to even begin coding. Can i just grab my username & smack it into that place like you can in the registry, or is it a little more complicated?

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Workaround for Shutdown.exe LUA bug

    possibly you could do it by adding a value to the correct registry key
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Workaround for Shutdown.exe LUA bug

    So you're saying that i can achieve this by adding a value to the registry?

    So i have have to find the registry location and then add my user name, or administrator or something?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Workaround for Shutdown.exe LUA bug

    I've done some research and there's no registry setting for this...

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Workaround for Shutdown.exe LUA bug

    yeah i find it is stored in the registry security database secedit.sdb you should be able to use the secedit commandline tool to add a add a security template
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Workaround for Shutdown.exe LUA bug

    Oh, ok. I've got a Excel sheet of just about every Active Directory setting and the Registry location for it. Some Active Directory settings don't have registry locations (Such as this one).

    How ever I'm not using Active Directory at the moment (I got confused). I'll have a look at what you've told me.

    Edit:
    Soo... wait... I'm going to have to create a duplicate security policy but with my one change applied to the duplicate and then the duplicate set as the default?
    Last edited by Slyke; Nov 2nd, 2007 at 10:55 AM.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Workaround for Shutdown.exe LUA bug

    Most group policies can be set using WMI.

    http://www.microsoft.com/technet/arc....mspx?mfr=true
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Workaround for Shutdown.exe LUA bug

    Sweet dude thanks for that!

    Would never have found it.

Posting Permissions

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



Click Here to Expand Forum to Full Width