G
Guest
I've run into a group policy synchronization issue that I'm hoping someone can provide some insight on (and maybe a workaround). The problem is that when I move the machine account to a different OU and wait for the domain controller to receive the change, the new group policy will not sync down to the workstation for about an hour (even if I try to force a synchronization with gpupdate or secedit). Here are the steps to reproduce the problem
1. Boot up a test workstation and logon to the network (Windows 2000 or Windows XP).
2. Create a vbScript on this test workstation that contains the following code.
' Show the distinguished name of the workstation:
Set oAd = CreateObject("ADSystemInfo")
MsgBox oAd.ComputerName, vbInformation, "Computer Name"
3. On a different workstation, open the AD Users and Computers and move the machine to a different OU that has different group policies applied.
4. On the test workstation, run the script to display the distinguished name of the computer until it shows the machine has moved to the new OU
(this can take up to 5 minutes in my environment because we have multiple domain controllers).
5. On the test workstation run "Secedit /refreshpolicy machine_policy /enforce" (if Windows 2000) or "Gpupdate /Force" (if Windows XP).
6. Check the registry and you will find that the group policies for the new OU of the computer have not synchronized down.
I've found that advancing the time of the test workstation 1 hour and running gpupdate or secedit again (even without the /force or /enforce switches) correctly synchronizes the group policy for the new OU. I added the "UserEnvDebugLevel" to the registry and reran this test and found that even though the script correctly detects the new distinguished name (using the ADSystemInfo object) that whatever is controlling the group policy synchronization is still using the old one. It acts as though it is caching this information and only rechecks the distinguished name of the machine once an hour.
I'm assuming this issue could happen if I were to move the user account to a different OU as well. Does anyone know of a way to force a policy update when the machine or user account has moved. If not, are there a registry setting that show what the distinguished-names of the machine and the user were when group policy was last synchronized. This would allow me to at least detect the problem in my scripts until the hour has passed and group policy synchronized properly. I've found "HKLM\Software\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Distinguished-name" under Windows XP but have not found the equivalent setting on Windows 2000 and have not found the equivalent settings for the user's distinguished name.
Andy
1. Boot up a test workstation and logon to the network (Windows 2000 or Windows XP).
2. Create a vbScript on this test workstation that contains the following code.
' Show the distinguished name of the workstation:
Set oAd = CreateObject("ADSystemInfo")
MsgBox oAd.ComputerName, vbInformation, "Computer Name"
3. On a different workstation, open the AD Users and Computers and move the machine to a different OU that has different group policies applied.
4. On the test workstation, run the script to display the distinguished name of the computer until it shows the machine has moved to the new OU
(this can take up to 5 minutes in my environment because we have multiple domain controllers).
5. On the test workstation run "Secedit /refreshpolicy machine_policy /enforce" (if Windows 2000) or "Gpupdate /Force" (if Windows XP).
6. Check the registry and you will find that the group policies for the new OU of the computer have not synchronized down.
I've found that advancing the time of the test workstation 1 hour and running gpupdate or secedit again (even without the /force or /enforce switches) correctly synchronizes the group policy for the new OU. I added the "UserEnvDebugLevel" to the registry and reran this test and found that even though the script correctly detects the new distinguished name (using the ADSystemInfo object) that whatever is controlling the group policy synchronization is still using the old one. It acts as though it is caching this information and only rechecks the distinguished name of the machine once an hour.
I'm assuming this issue could happen if I were to move the user account to a different OU as well. Does anyone know of a way to force a policy update when the machine or user account has moved. If not, are there a registry setting that show what the distinguished-names of the machine and the user were when group policy was last synchronized. This would allow me to at least detect the problem in my scripts until the hour has passed and group policy synchronized properly. I've found "HKLM\Software\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Distinguished-name" under Windows XP but have not found the equivalent setting on Windows 2000 and have not found the equivalent settings for the user's distinguished name.
Andy