Jump to content


Kingen

OSD Join certain domain based on the deafultgateway the computers on?

Recommended Posts

OK, then mys last post is what you should be looking at. In your first screenshot, make sure you have the OU populated. This may not make a difference if you already have the machine prestaged in AD, but it could help eliminate any potential issues.

 

In the second screen shot click Add Condition, then add this to the WMI Query:

Select * From Win32_NetworkAdapterConfiguration Where DefaultIPGateway="192.168.40.1"

 

Once it has checked tis condition, it will join DomainA and move on to the next part of the sequence (which is "Join DomainB", if it does not meet the condition it will not join DomainA and move to the next part.

Share this post


Link to post
Share on other sites

OK, then mys last post is what you should be looking at. In your first screenshot, make sure you have the OU populated. This may not make a difference if you already have the machine prestaged in AD, but it could help eliminate any potential issues.

 

In the second screen shot click Add Condition, then add this to the WMI Query:

Select * From Win32_NetworkAdapterConfiguration Where DefaultIPGateway="192.168.40.1"

 

Once it has checked tis condition, it will join DomainA and move on to the next part of the sequence (which is "Join DomainB", if it does not meet the condition it will not join DomainA and move to the next part.

 

I will try this, this was actually what i was looking for! :D:lol:

Share this post


Link to post
Share on other sites

Hi kingen

 

This is good stuff...did this work for you??

 

I am interested to know as i will soon be setting this up on a multi-domain site and always wondered how to have one TS with a query in it to join a specific domain.

 

Thanks

 

Rocket Man

Share this post


Link to post
Share on other sites

I have tried the following, but it does not work:

Select * from Win32_NetworkAdapterConfiguration where DefaultIPGateway='192.168.40.1'

 

This will not work because the adapters are stored in an array.

 

 

I found a way to do this use this query:

 

Select * FROM Win32_IP4RouteTable

WHERE Destination='0.0.0.0' AND NextHop='192.168.40.1'

 

 

This queries the routing table, no details about the adapter need to be known.

 

It should work, but it does not!

 

 

s1.jpg

 

s2.jpg

Share this post


Link to post
Share on other sites

That seems strange. Are you specifying the OU? If not, then that could be your issue. Also, try it with the machine alrady prestaged in AD.

 

Also, I see that you have "continue on error" checked. Uncheck that and see if you do get an error and on which item it fails.

Share this post


Link to post
Share on other sites

If you use MDT and run 'use toolkit package' followed by the 'gather' step, you can use the variable DefaultGateway001. You can also apply the proper OU in your customsettings.ini this way, by setting the variable OSDOUName. This way you save a lot of TS steps.

 

Another benefit is that you can test it without starting the Imaging sequence on any computer. Just run the ZTIGather.wsf from the command line.

Share this post


Link to post
Share on other sites

That seems strange. Are you specifying the OU? If not, then that could be your issue. Also, try it with the machine alrady prestaged in AD.

 

Also, I see that you have "continue on error" checked. Uncheck that and see if you do get an error and on which item it fails.

 

Ive tried specifying OU and not, neither work. "Continue on error" will always show errors even if its checked or not. It just ignores it and continue the TS even if if failed.

 

Im thinking of sending this to microsoft telling them it's a bug. I mean it should work, but it doesn't.

 

I wil try it in my 2007 enviorment see if it goes through there..

Share this post


Link to post
Share on other sites

If you use MDT and run 'use toolkit package' followed by the 'gather' step, you can use the variable DefaultGateway001. You can also apply the proper OU in your customsettings.ini this way, by setting the variable OSDOUName. This way you save a lot of TS steps.

 

Another benefit is that you can test it without starting the Imaging sequence on any computer. Just run the ZTIGather.wsf from the command line.

 

Would you mind giving me the full query for the condition, using the new variable DefaultGateway001 ?

 

I'm currently trying to get something going using this (running a script that renames, based on subnet/gateway) but i'm not sure what to put as the full wmi query (Select * From _____?_____ Where DefaultGateway001="0.0.0.0"

 

any help would be greatly appreciated!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.