Jump to content


We use cookies to let you log in, for ads and for analytics. OK

Photo

How can I easily prompt for a computer name in Configuration Manager 2012




  • Please log in to reply
47 replies to this topic

#1 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 7,212 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 11 May 2012 - 01:41 PM

When you install new computers it would be nice to be able to easily name the computer as part of the deployment, otherwise the new computer could end up with a name like MININT-XRGHJTF unless you import it into Configuration Manager first. You can script around this in your task sequence or use web services or HTA's but the easiest method of all is to set a Collection variable called OSDComputerName. This method does not require any scripting all you need to do is to Enable Unknown Computer support in the Distribution Point PXE tab settings.

enable unknown computer support.png

To prompt the end user to enter a computer name In Configuration Manager 2012 by using the OSDComputerName variable you first need to think about the computers you are aiming this at, and in this case the computers are unknown computers, that is, they are unknown to Configuration Manager.

Step 1. add the collection variable

Now that we know that they are unknown we need to select the Unknown Computers collection called All Unknown Computers. Right click and choose Properties.

all unknown computers properties.png

select the Collection Variables tab and click on the Yellow star burst button as shown below

collection variables.png

enter the following variable name when prompted OSDComputerName, remove the checkmark from Do Not Display this value in the Configuration Manager console as in the screenshot below

new variable.png

click ok and apply so that it looks like this

OSDComputerName.png

Step 2. Make sure you have Deployed a task sequence to the Unknown Computers collection

Verify that you have deployed your chosen task sequence to the Unknown Computers collection by selecting the task sequence and clicking on the Deployments tab. The deployments listed should include one for the All Unknown Computers collection as shown below. If not, then create a new deployment for the task sequence and choose the All Unknown Computers collection for that deployment.

deployed to all unknown computers.png


Step 3. PXE boot a new computer

PXE boot a new computer. Press F12 when prompted

Note: make sure the computer is NOT present in Configuration Manager prior to this, either as a previous computername or as an UNKNOWN object, if it is, highlight it in All Systems and delete it.

computer pxe booting.png

select your task sequence and click next

select task sequence.png

now you will see a Task Sequence window called Edit Task Sequence Variables

edit task sequence variables.png

double click on OSDComputerName, the following should appear

OSDComputerName double click.png

type in a computername

computername entered.png

click ok and the computername value should be listed to the right of the variable name as shown below

value listed.png

click next and the task sequence completes as normal

Step 4. Verify that it worked

Now that the Task Sequence is complete you can logon to your computer, bring up the computer properties and note the computername is what you entered earlier.

computername.png

the variable is set during the Apply Windows settings step of the task sequence and you can see the collection variable being added in the SMSTS.log file (found in C:\Windows\CCM\Logs)

adding collection variable.png

that's it, I told you it was easy !

cheers
niall
  • Junu, FazzaGBR and loon like this
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog



#2 Junu

Junu

    Newbie

  • Established Members
  • Pip
  • 4 posts

Posted 11 May 2012 - 06:15 PM

Wow that's cool. going to try... TY

#3 nry

nry

    Advanced Member

  • Established Members
  • PipPipPip
  • 97 posts

Posted 14 May 2012 - 08:44 AM

Superb, I was wondering on that one!

#4 dani3l

dani3l

    Member

  • Established Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Germany

Posted 15 June 2012 - 07:23 AM

is there a possibility to get the old name from sccm if i want to reinstall a computer?

In SCCM 2007 this script works fine http://14rocks.blogs...puter-name.html
But in SCCM 2012 i only get name like minint-ABC123... have you an idea?

#5 moustafafafa

moustafafafa

    Newbie

  • Established Members
  • Pip
  • 5 posts

Posted 17 June 2012 - 06:59 AM

Unknown Computer Bug in Configuration Manager 2012 Even the RTM
When you are using OSDComputerName variable for All Unknown Computers
Please Help me
Posted Image

Posted Image
Posted Image

#6 Steve Murphy

Steve Murphy

    Member

  • Established Members
  • PipPip
  • 11 posts

Posted 20 June 2012 - 08:37 PM

moustafafafa - Any luck figuring this out? Or any more information about what problems you are having with it?

#7 CrapCleaner

CrapCleaner

    Newbie

  • Established Members
  • Pip
  • 3 posts

Posted 24 June 2012 - 05:42 PM

Should these tasks (step 2) already be available right after the installation or do you have to create them manually?

#8 hans.swolfs

hans.swolfs

    Advanced Member

  • Established Members
  • PipPipPip
  • 36 posts

Posted 26 June 2012 - 06:08 AM

experiencing the same issue as moustafafafa and I find it utterly annoying...
I was thinking something went wrong with my sccm install but apparently not. I'm going to google around a bit to check what can be done.

#9 hans.swolfs

hans.swolfs

    Advanced Member

  • Established Members
  • PipPipPip
  • 36 posts

Posted 26 June 2012 - 06:19 AM

apparantly we'll have to wait for MS for a fix :)
best solution for now is to delete the unknown entries in sccm...

#10 n00blar

n00blar

    Advanced Member

  • Established Members
  • PipPipPip
  • 74 posts
  • Gender:Male
  • Location:USA

Posted 26 June 2012 - 06:37 PM

Hey guys, I do it a slightly different way, mainly because we like to use the asset number from our DELL computers as the computer name account.

Here's the link.

#11 readyyy

readyyy

    Newbie

  • Established Members
  • Pip
  • 1 posts

Posted 08 August 2012 - 06:30 PM

I had the same issue as moustafafafa when the computer was joined to a workgroup, that's what he probably did. When using the task sequence to join the computer into a domain it works!

#12 Rocket Man

Rocket Man

    Advanced Member

  • Moderators
  • PipPipPip
  • 981 posts
  • Gender:Male
  • Location:Ireland
  • Interests:System Center 2007,2012

Posted 08 August 2012 - 06:50 PM

Hi Guys...Dani3l

I never new you could do variables to add a computer name (cool)......but this is what I use in SCCM 2012 and it works just as it should (Dani3l this works for me)....you can leave it attached to your TS at all times and during OSD time when SCCM database knows the computer name it will bypass this step and it will hold on to it's old name, if it does not know the computer name(out of the box or Unknown) it will prompt you to enter one in....pretty cool..

Dim sNewComputerName, oTaskSequence, sTSMachineName, bPromptName
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
' Get the name the computer is set to receive and truncate to first 6 letters
sTSMachineName = lcase(oTaskSequence("_SMSTSMachineName"))
If left(sTSMachineName,6) = "minint" Then
bPromptName = True
ElseIf sTSMachineName = "minwinpc" Then
bPromptName = True
Else
bPromptName = False
End If
' Note: The wscript.echo commands are logged in SMSTS.log for troubleshooting. They are not displayed to the end user.
If bPromptName = True Then
wscript.echo "Detected that the computer name is scheduled to receive a random value. Prompting user to input a standard name."
sNewComputerName = InputBox ("Please enter a standard computer name to continue.", "Computer Name", , 30,30)
oTaskSequence("OSDComputerName") = UCase(sNewComputerName)
wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName
Else
wscript.echo "Computer set to receive a standard name, continuing as is."
End If





Rocket Man
Rocket Man

#13 reddet

reddet

    Newbie

  • Established Members
  • Pip
  • 1 posts

Posted 17 September 2012 - 03:36 PM

Worked like a charm. Brilliant! Thank you!

#14 Matt Hinson

Matt Hinson

    Newbie

  • Established Members
  • Pip
  • 7 posts
  • Gender:Male

Posted 15 November 2012 - 05:52 AM

experiencing the same issue as moustafafafa and I find it utterly annoying...
I was thinking something went wrong with my sccm install but apparently not. I'm going to google around a bit to check what can be done.


This is a byproduct of leveraging unknown computer support. During the TS process, SCCM has to create an object for any "Unknown" computers so that the SCCM database can "recognize" it and thus service it in the TS. If during the TS, the TS fails, SCCM does not remove the "orphaned' Unknown computer object. It has to be manually deleted.

http://blogs.technet...on-manager.aspx

#15 opdsccm

opdsccm

    Member

  • Established Members
  • PipPip
  • 16 posts

Posted 12 December 2012 - 11:13 PM

Hello:

I was trying to accomplish this by right clicking on the 'All Unknown Computers' collection, but the properties for this collection are all greyed out and won't let me make any modification. Please help! Thanks!

#16 Rocket Man

Rocket Man

    Advanced Member

  • Moderators
  • PipPipPip
  • 981 posts
  • Gender:Male
  • Location:Ireland
  • Interests:System Center 2007,2012

Posted 12 December 2012 - 11:54 PM

What version are you running?
Rocket Man

#17 opdsccm

opdsccm

    Member

  • Established Members
  • PipPip
  • 16 posts

Posted 13 December 2012 - 09:46 PM

SCCM 2012 sp1 (beta). Thanks Rocket Man!!

#18 Rocket Man

Rocket Man

    Advanced Member

  • Moderators
  • PipPipPip
  • 981 posts
  • Gender:Male
  • Location:Ireland
  • Interests:System Center 2007,2012

Posted 13 December 2012 - 11:58 PM

Does not work in beta!!

It should be sorted in RTM SP1....

For now you could use the script that I posted previous...this does work in all versions!
Rocket Man

#19 opdsccm

opdsccm

    Member

  • Established Members
  • PipPip
  • 16 posts

Posted 14 December 2012 - 03:44 PM

Thank you so much Rocket Man! I will use the script for now. Appreciate it!!

#20 a4r0

a4r0

    Member

  • Established Members
  • PipPip
  • 23 posts

Posted 16 March 2013 - 12:01 PM

is there a way to Add a description which then gets added in to AD once the OSD is completed. ? 






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users