Windows Server TechCenter > Windows Server Forums > Directory Services > Active Directory VBS scripting, The directory property cannot be found in the cache?
Ask a questionAsk a question
 

AnswerActive Directory VBS scripting, The directory property cannot be found in the cache?

  • Tuesday, November 03, 2009 4:10 PMKenneth_Lindberg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi. not sure if this is in the right part of the forum, if not maybe someone can move it.

    As we are a big corporation with a lot of different sites I have made a script that simplifies the linking and enabling of GPO's for OUs.s 

    A few times this script has failed on a one type of OU's, the "newly" created ones.. even the ones that has been in our AD for a couple of weeks can have this problem. This is the error that my script give me: The directory property cannot be found in the cache.

    here is a small part of the script that failes:

    Set objOU = GetObject("LDAP://" & strOUDN)
    strGPLink = objOU.Get("gpLink") <- it failes here
    objOU.Put "gpLink", strGPLink & "[" & strGPOADsPath & ";1]"
    objOU.SetInfo

    Now the thing is, when I run this on our management server it failes.. then I go to my client and run the script and it runs OK.

    The I go to the server again and run it on another sub OU in the same problematic OU, but before I do that I manually link a GPO to that OU and then I run my script and voila! it works..

    Is the problem like the description says? The directory property cannot be found in the cache. is the local cache on the server/computer unsynced with the rest of the AD(if there are any?)  is one of the many DC unsynced and miss the information? why does it start to work after I "trigger" the OU manually?

Answers

  • Friday, November 06, 2009 9:02 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    This is normal behavior. I have tested on my system, if old OU doesn’t have any GPO, the gpLink is not populated and caused this error.

    Please refer to the following article to create the script to link GPO to OU.

    Scripting the addition of Group Policy links
    http://support.microsoft.com/kb/248392

    Thanks.

    This posting is provided "AS IS" with no warranties, and confers no rights.

All Replies

  • Tuesday, November 03, 2009 4:40 PMMarcin PolichtMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Verify whether both server and client computers point to the same DC when the script is executed and that you are logged on using the same user account...

    hth
    Marcin

  • Wednesday, November 04, 2009 12:07 PMKenneth_Lindberg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi.

    The username is the same, the DC is different. But all DC's should be syncronised and have the same information?
  • Friday, November 06, 2009 9:02 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    This is normal behavior. I have tested on my system, if old OU doesn’t have any GPO, the gpLink is not populated and caused this error.

    Please refer to the following article to create the script to link GPO to OU.

    Scripting the addition of Group Policy links
    http://support.microsoft.com/kb/248392

    Thanks.

    This posting is provided "AS IS" with no warranties, and confers no rights.