# Logon Script GPO



## Kotha (Feb 3, 2012)

Hello

before each site had their own domain and logon script the old way (in the profile). 
Now we have a single domain (each site got their OU structure) and we would like to implement a global logon Script via GPO. 
the task of the global logon script should be to look for the user account attribut field "office" (physicalDeliveryOfficeName) and to run the logon script starting with the office field data. the office field shows the site code of the user or is blank if its in case a service account.

for example:
a GPO named "Global-LogonScript" applies to all users of the company. (dc=w2k8 r2 ¦ dfl=2k3 ¦ ffl=2k3)
"Global-LogonScript" runs "Logon.cmd", which query the office field in the users AD profile attribut and..
..if the office field of the user is "US01", then it should run "%logonserver%\netlogon\US01-LogonScript.cmd" 
..if the office field of the user is "JP01", then it should run "%logonserver%\netlogon\JP01-LogonScript.cmd"
..if the office field of the user is blank, then just exit the logon script

i guess we could query the office field via vbs script, but..
..is it possible to tell the logon script, if the vbs query finds "US01" in the office field to run US01-LogonScript.cmd?

any help would be great
thanks.


----------



## Rockn (Jul 29, 2001)

Couldn't you have just created regional OU's for the different locations and then applied a script at the top level of that OU?


----------



## Kotha (Feb 3, 2012)

we could create more than one GPO for logon script, but i'm asking myself if it would be possible to tell a batch to run another batch because of the value of the profile attribut in a user account?


----------



## Rockn (Jul 29, 2001)

I am sure it can be done with a VB script like you stated earlier.


----------

