Cannot find any global catalogs in forest

It’s been a while since my last post, but my excuse can be that I only publish things which I find really interesting. Also, I had been quite busy recently. I know, who wasn’t?

OK, what I quickly want to share with you a quick fix for the following issue:
When you try to do schema preparation during your Lync deployment, you face the error message:

Install-CSAdServerSchema : Command execution failed: Cannot find any global catalogs in forest "d01.local".

You are sure, that you have the GC available in your forest. So what is going on here?
The answer might be for this question, that you don’t have a GC in the site (AD site) of your wannabe Lync server or from where you ran Install-CSAdServerSchema!

You can easily verify it by checking the sites and subnets in the Active Directory Sites and Services console.

To make it clear what happens in the background before you get the error message, here is a screenshot from Wireshark, showing the DNS query to find the GC in the site: