|
-
Oct 28th, 2007, 06:15 AM
#1
Thread Starter
Fanatic Member
[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?
-
Oct 28th, 2007, 03:40 PM
#2
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
-
Oct 29th, 2007, 09:51 PM
#3
Thread Starter
Fanatic Member
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?
-
Nov 1st, 2007, 09:57 PM
#4
Thread Starter
Fanatic Member
Re: Workaround for Shutdown.exe LUA bug
I've done some research and there's no registry setting for this...
-
Nov 2nd, 2007, 04:36 AM
#5
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
-
Nov 2nd, 2007, 10:51 AM
#6
Thread Starter
Fanatic Member
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.
-
Nov 2nd, 2007, 11:02 AM
#7
Re: Workaround for Shutdown.exe LUA bug
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Nov 5th, 2007, 10:00 AM
#8
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|