Need help setting up a scheduled task via GPO

2008 R2 DC windows 7 64 PC's
Im attempting to setup a GPO that will run a script that I wrote very basic "net user administrator /active:no" the script works when I run it locally on a PC but I cant seem to get the script to run via GPO. I have tried both computer and user\preferences\control panel settings\scheduled task.
I have the scheduled task configured like this:
Action : create
Run: I have the script saved on the local c:drive of the DC and the path reflects, I have also tried to put the actual command there and the arguments below that didnt work either
Start in c:\
I also have it set to run at logon although the time still shows when I select logon for the schedule.

When I run gpresult on the test PC Im using it shows the GPO that has the schdule task configured has been applied
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Quick question, any reason why this is being configured as a scheduled task instead of a computer startup script?Capture.JPG-saige-
bankadminAuthor Commented:
No specific reason Im open to anyway to get this done. Ill give it a try

I also tried to run the scheduled task with domain admin creds, still didnt work
I was only suggesting this because it really only needs to run once when the computer starts up and using a scheduled task for this is basically overkill.

I would, however, either beef up the script or create a new GPO to ensure that the script only runs on client computers and not servers.

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

bankadminAuthor Commented:
I have my Servers seperated in AD (OU's) so if I do get this to work it wont apply to my servers.  I setup a logon script and it didnt work I rebooted the PC I did a gpupdate /force and it shows the GPO did apply via gpupdate. I setup the logon script to run under computer and user...
What are the contents of the startup script?

bankadminAuthor Commented:
Its  a .cmd file I created with notepad and this is whats in it
net user administrator /acitve:no
It does work when I save it to a work station and run it manually
For testing, I create a GPO and WMI Filter for one specific machine.  I linked the WMI Filter to this one specific machine and created a script called DisableAdministrator.cmd with only the command:
net user Administrator /active:no

Open in new window

I logged into the computer defined by the WMI Filter and verified that the Administrator acount was set to an active status:Capture.JPG
And run an RSoP (Resultant Set of Policy); in Logging Mode; to ensure that the policy has been applied the the system (the startup script should only run when the computer starts up):Capture.JPG
I rebooted the system and viola:Capture.JPGCapture.JPG-saige-
You can also use the event logs to determine if the script has been ran on the system:Capture.JPGCapture.JPG-saige-
bankadminAuthor Commented:
I checked the system logs and I only had one entry per boot for group policy and it states "The Group Policy settings for the user were processed successfully. New settings from 3 GPO's were detected and applied".
I also ran the GSOP on the PC Im testing with and it shows the startup script  just like your screen shot does.
I have this PC in its own OU and the only GPO I have directly linked to the OU is this test one that I have the startup script configured in, however its getting a couple of GPO's that are applied to everything in our domain.

Its still not working.
Just verifying that this is a Computer startup script and not a User login script?  Also can you post an RSoP screen shot?

Also what is the OS of the client computer?  What are your Forest/Domain Functional Levels and the OS of your DC?

bankadminAuthor Commented:
Server 2008 R2 DC, PC is a windows 7 32 bit.. Not sure what you mean of forest/domain functional levels. Our AD is just the domain on top and the OU's underneath with PC's, users, groups, ext..
First lets change the policy name to Local Admin Disable (Microsoft acts funny when you use special characters in things like identifiers and such):My policy name.Next, ensure that your policy has the script identified soley as such (again without any special characters):My policy for the computer startup script identifies the script itself, no path information is necessaryFinally, if you click Show Files you should see something along the lines of:The script itself is located on the SYSVOL share under the policy folder.  The policy is identified by a GUID.
You do not want to try to guide the policy, client or dc as to the location of the script, the policy has a place for scripts and expects them to be located in the specified location (its the same for user scripts).


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bankadminAuthor Commented:
I have to drop this right now and Im out tomorrow, I will pick it up Monday and let you know how it goes.

bankadminAuthor Commented:
Its working I had the path defined to a location that was different than the location it was expecting to see it in.

Thanks for all the help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.