This is probably the number one problem we have with our YJ's. There are several different avenues to consider but they all take a little work. It all depends on how much time vs money you want to spend on the situation and what usage you'll jeep will see in the end. Forgoing all the hoopla there are four major options you have sitting in front of you:
1) Replace the vacuum lines and shift fork on the cad (central axle disconnect) and utilize the vacuum system the way that jeep designed it to run.
2) Posilock cable to activate the fork independently of the transfer case shift lever. It can be useful when using a front locker or if you launch a boat on a ramp and would like 2wd low range. You can make your own which is a lot cheaper than the big box catalog offerings. However there are several that are not as reliable as you would think.
3) You can lock a new shift fork over permanently. I will let this thread speak for itself:
Read the included link inside that thread for Dodger's writeup.
4) You can replace the two piece system with one piece and the lights will work using the link above.