Jump to content


  • 0
::_Christian_::

Join domain depending on computername

Question

Hi everybody!

 

We're using SCCM 2007 R2 in Active Directoy forest with several subdomains for our subsidiaries. Currently we're creating the bare-metal machines for our subsidiaries with a SCCM task sequence that deploys Windows XP SP3.

Now I want to customize this task sequence that new AD computer accounts will be directly create in the subdomain for a subsidiary - depending on the computer name I previously created with the SCCM console.

For example: I want to create a mobile computer for the subsidiary in China with the inventory number 1234. So I create a new computer object in SCCM with the name LPCN1234 (LP for a mobile computer, CN for China and 1234 for the inv. number), the MAC address and create a direct membership to the "OSD Install Windows XP" collection. Can I add a condition for the "Apply network settings" action that queries the computername to create the computeraccount in the China domain (and the mobile devices ou) at this point of the OS deploy process? Is there a variable I can use for this?

Any ideas?

 

THX

 

Christian

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

good question, in my suggestion below I am not using the computername to decide where the computer shall be placed but by using collection variables,

 

perhaps someone with a VBS script that does domain OU joining based on computername can chirp in,

 

you could use computer variables (right click on the computer in the collection and set a variable called JoinDomain=DOMAIN or similar

 

or you could use collection variables to apply to all computers in that collection,

 

to do this, simply right click on your deploy collection and choose Modify collection settings, here is an example of two variables on a collection

 

Set the following Collection variables to something like this...

 

JoinDomain=SCCM2007

MachinObjectOU=OU=MyOu,DC=MyDom,DC=MyCompany,DC=com

 

machineobjectou.jpg

 

then edit your Task Sequence to use the variables like so

 

joindomain variables.jpg

 

does this help ?

 

TIP: to verify that your Collection Variables are indeed being passed through to your task sequence bring up a command prompt in WinPE and use TSENV2 to list the variables

 

eg:

tsenv2 list > variables.txt

 

you can then review the variables.txt file to find your collection variables

Share this post


Link to post
Share on other sites

  • 0

good question, in my suggestion below I am not using the computername to decide where the computer shall be placed but by using collection variables,

 

perhaps someone with a VBS script that does domain OU joining based on computername can chirp in,

 

you could use computer variables (right click on the computer in the collection and set a variable called JoinDomain=DOMAIN or similar

 

or you could use collection variables to apply to all computers in that collection,

 

to do this, simply right click on your deploy collection and choose Modify collection settings, here is an example of two variables on a collection

 

Set the following Collection variables to something like this...

 

 

 

post-1-12543159202548_thumb.jpg

 

then edit your Task Sequence to use the variables like so

 

post-1-12543159364722_thumb.jpg

 

does this help ?

 

Im not sure.

But shouldent you be able to do this with conditions? If you add several "Apply network Settings"?

 

For example:

IF computername = LPCN% apply this task sequence step (add to china domain)

IF computername = LPSW% apply this task sequence step (add to sweden domain)

Share this post


Link to post
Share on other sites

  • 0

Hi!

First, thanks for your answers!

 

@wmmayms & Peter

Yeah, that was my first thought. I tried to create a Apply Network Settings action with the condition "if the computername is like LPCN%" and a second Apply Network Settings action with the condition "if the computername is like LPSW%" and so on (for every Domain and OU a conditioned Apply Network Settings action ). Sadly I had no success. I think the reason was that the %computername% variable isn't set at this point of the task sequence...

 

@anyweb

That could be the solution. The more I thought about that, the more I like this. So I'll have to create for every Domain and OU one Collection with a Collection variable for the Domain and the ldap OU path... Yeah, I think that's cool! Thanks a lot!

By the way, I see you defined variables for the regional and language settings. Where and how do you use them?

 

Thanks!

 

Christian

Share this post


Link to post
Share on other sites

  • 0

the regional and language settings are used as follows

 

create a blank (or edit existing) sysprep.inf file with the following lines in it

 

 

[unattended]

InstallFilesPath=C:\sysprep\i386

UpdateInstalledDrivers=Yes

DriverSigningPolicy=Ignore

 

[sysprep]

[RegionalSettings]

SystemLocale=%SystemLocale%

UserLocale=%SystemLocale%

UserLocale_DefaultUser=%SystemLocale%

SystemInput=%SystemInput%

InputLocale=%SystemInput%

 

[GuiUnattend]

TimeZone=%TimeZone%

 

then create a sysprep package of the above file and add it to your task sequence,

 

if you use MDT integration in SCCm you can use ztigather and zticonfigure scripts in the TS and they will poke the correct values you set on the collection variables into your sysprep.inf during deployment

 

 

try it and post your results here

Share this post


Link to post
Share on other sites

  • 0

Hi!

 

I'm still testing my new Task Sequence using the variables and got good result. When I'm finished and happy with the results, I'll write that here.

@anyweb

I got one question regarding the answer file: You used a variable and setting named %SystemInput%. I don't find any information about that setting in the sysprep/unattended documentation. Can you tell for what this is used for?

 

THX again!

 

Christian

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
Answer this question...

×   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.