Jump to content

how to script gpedit.msc (local group policy)


Guest snowch
 Share

Recommended Posts

Guest snowch

I have a few hundred w2k desktops on a samba (nt) domain. The desktops need to be restricted with local group policies that are implemented using gpedit.msc.

Unfortunately, there doesn't seem to be a way of exporting and importing the policies. I would like to try to script the changes with autoit. However, it appears that gpedit.msc has been designed for use with the mouse only as there are no menu's of shortcut keys.

Is my only option to script the sending of TABS to move around with gpedit.msc, followed by sending mouse clicks?

Has anyone tried on this list tried to automate setting up group policies in this way?

Thanks in advance,

Chris

Link to comment
Share on other sites

Guest snowch

secedit doesn't appear to let me roll out changes to "User Configuration" such as I.E. settings.

Link to comment
Share on other sites

Yes, made something like that.

To avoid some problems after a M$-Patch it is neceassary to use gpedit to

set the setting what to invoke or not invoke.

The solution is to simply use the cursor keys to navigate through the menu.

Use TAB to switch into the right Panel and use ENTER to change a value.

Short example, only making something useful in the german version of win2k, I'm afraid...

Run(@ComSpec & " /c gpedit.msc", "", @SW_HIDE)
WinWait ("Gruppenrichtlinie")
WinActivate ("Gruppenrichtlinie")
WinWaitActive ("Gruppenrichtlinie")

; local security settings
Send ("w")
sleep (250)
send ("{RIGHT}")
sleep (250)
send ("si")
sleep (250)
send ("{RIGHT}")
sleep (250)
send ("l")
sleep (250)
send ("{RIGHT}")
sleep (250)
send ("s")
sleep (250)

; Enter settings window 
send ("{TAB}")
sleep (250)
send ("v")
sleep (250)

; select setting and change it
Send ("{ENTER}")
sleep (250)
send ("w")
sleep (250)
Send ("{ENTER}")

Winclose ("Gruppenrichtlinie")

Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)

Link to comment
Share on other sites

  • 5 years later...

Hi Guyz, I got a school work, where we were asked to create a script to disable and enable control panel and internet option access in both windows xp and vista. And am new to all this script stuff, pls can someone help me the due date is really close.

Link to comment
Share on other sites

Hi there.

You are an idiot. This is a 5 YEAR OLD THREAD. You should be banned for not being able to read the dates.

Control panel and many other things can be disable, but because you're some script kiddy using the age old it's for school excuse, I'm not going to tell you how. And yes I get a kick out of abusing the young'uns.

My ass this is homework.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...