Question Locked

Logon scripts

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi i am trying to deploy a script on all worstations in the domain, but the script just wont run, i tried running it as administrator on the DC where AD is and still wont run.
The script is just a *.bat file to change permissions on certain folder on all workstations.

xcacls c:\test /g everyone:c /Y

Someone please help!!!!

11 replies

by retro77

That command works, so its probably the execution of the .bat file. Where are you putting the .bat file and where in the account are you putting it? or are you running it VIA GPO?

by victor.dane

i tried running it as a logon script from GP
and as starup script from GP as well.
I also tried running it from the profile tab on the user AD properties. Tried putting the script in the logon and startup default folder on the PDC as well as shared location.

by retro77

If you put just the .bat filename under the profile tab under login script, copy the .bat file to the netlogon folder of your DC. Let the file replicate to all of your DCs and also let the profile change replicate. then log out and log back in again to see if the folder is changed.

Also keep in mind that the login script is run under the context of the user. So if the user doesnt ahve access to change the permissions currently, the .bat change will fail.

Let us know how it goes!

by victor.dane

How do i make the user change permission to that folder without giving admin right?

by lowlands

To put the script in scripts section of Computer Configuration of your GPO. That way the script will run under the system account instead of under the user account that logs on.

by maniacman

That should be able to execute the bat file under the context of a user with elevated priveleges.

by retro77

The built in runas command does not allow to pass passwords to it.

by lowlands

There are some different things that might be going wrong.
- Question 1; Can the script be found?
- Question 2; Does the script run?
- Question 3; Permissions

Try creating a script that just does something like dir C:\ >> %TEMP%\test.txt

If that works, you know the script can be found and it runs properly on either bootup or user login, depending on where you put it in your GPO.

You can also try using cacls instead of xcacls, I don't believe xcacls is present on all systems, bt cacls is. One more thought, if you're sure you do have xcacls on all your workstations, is to use the full path in your batch file.

This discussion is closed to new replies.