Jump to content


  • 0
anyweb

how can I Import Computers Using a file in SCCM 2007 ?

Question

In the Operating System Deployment section of SCCM right click on Computer Association and choose Import Computer Information

 

import_computer_information.jpg

 

when the wizard appears select Import Computers using a file

 

from_a_file.jpg

 

The file itself must contain the information we need in this (CSV) format

 

COMPUTERNAME,GUID,MACADDRESS

 

(sample below)

 

deployvista,3ED92460-0448-6C45-8FB8-A60002A5B52F,00:03:FF:71:7D:76

NEWCOMP1,55555555-5555-5555-5555-555555555555,05:06:07:08:09:0A

NEWPXE,23CA788C-AF62-6246-9923-816CFB6DD39F,00:03:FF:72:7D:76

w2k8deploy,BFAD6FF2-A04E-6E41-9060-C6FB9EDD4C54,00:03:FF:77:7D:76

 

if we look at the last line, I've marked the computer name in Red, the GUID in BLUE and the MAC address in GREEN, separate these values with commas as above.

 

w2k8deploy,BFAD6FF2-A04E-6E41-9060-C6FB9EDD4C54,00:03:FF:77:7D:76

 

the file can be a standard TEXT file that you create in notepad, and you can rename it to CSV for easier importing into our wizard...

 

so, click on Browse and browse to where you've got your CSV file

 

on the Choose Mapping screen, you can select columns and define what to do with that mapping, eg: you could tell it to ignore the GUID value (we won't however)

 

ignore_guid.jpg

 

on the next screen you'll see a Data Preview, and this is useful as it will highlight any errors it finds with a red exclamation mark, in the example below a typo meant that it correctly flagged the MAC address as invalid

 

error.jpg

 

so edit your CSV file again and fix the error, click previous (back) and try again until it looks like this

 

here's a sample file..macguidcomputername.csv

 

allok.jpg

 

Next choose the target collection where you want these computers to end up in

 

select_collection.jpg

 

review the summary

 

summary.jpg

 

in SCCM collections, we can now see the computers we've just imported from File,

 

computers_added.jpg

 

thats it !

 

If you want to script this then read this post on MSDN

 

cheers

anyweb

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

hi there,

 

can this be done with the computer name only, i.e drop the mac and guid ???

 

only my machines are already in SCCM and displaying but i need to define this to a collection based off the CSV file with computer name only in it ??

 

hope you can shed some light ?

 

cheers

 

Matt

Share this post


Link to post
Share on other sites

  • 0

What is the easiest way to get the MAC &/|| GUID of a group of machines? or is there no easy way and it all has to be done manually?

EDIT: By 'manually', I mean going around to every computer and writing it down/copy pasting

Share this post


Link to post
Share on other sites

  • 0

What is the easiest way to get the MAC &/|| GUID of a group of machines? or is there no easy way and it all has to be done manually?

EDIT: By 'manually', I mean going around to every computer and writing it down/copy pasting

 

 

Intel provide a script as part of their vPro offering that can be used to automatically import the details into an SCCM collection from a target PC. This is available here:

 

SCCMauto

 

I have modded the script to allow the details to be appended to a csv file as I was having firewall issues when automatically importing the details into SCCM.

 

Just insert the code into a .vbs file and run from a command prompt using the cscript command

 

'Create an object to connect to the local WMI provider
Set objService  = GetObject("winmgmts:\root\cimv2")

'Update the status on the screen
wscript.echo "Looking up host name, FQDN, MAC & UUID..."

'Get the MAC, hostname & DNS information 
Set objNetwork = objService.ExecQuery ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled = True")
for each objItem in objNetwork
   strMAC = objItem.MACAddress
   'If the computer name was not passed as a command line argument, read it from the local WMI interface
if strHostName="" then
	strHostName = Ucase(objItem.DNSHostName)
end if
if strDNSSuffix="" then
	strDNSSuffix = Ucase(objItem.DNSDomain)
end if       
   strDNSDomain = objItem.DNSDomain

next

'Combine the computer name and DNS suffix to create the computer's FQDN
strFQDN = Ucase(strHostName & "." & strDNSSuffix)


'Get the UUID
Set objSysComps = objService.ExecQuery("Select * from Win32_ComputerSystemProduct")
set objSysUUID = objService.ExecQuery ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled = True")
for each objItem in objSysComps
   strUUID = objItem.UUID
next

'Echo the values that will be added to the SCCM server
wscript.echo
wscript.echo "Host Name: " & strHostname
wscript.echo "FQDN: " & strFQDN
wscript.echo "MAC: " & strMAC
wscript.echo "UUID: " & strUUID
wscript.echo

Dim Filename 
Dim OutputFile 


Filename = "PC-Details.csv"	'File to output results to 

Set objFSO = CreateObject("Scripting.FileSystemObject") 
If not objFSO.FileExists(Filename) then 
Set objFile = objFSO.CreateTextFile(Filename) 
Wscript.sleep(2000)	'Pause while file is being created 
End If 


'If objFSO.FileExists(Filepath & Filename) then 
'Set objFile = objFSO.GetFile(Filepath & Filename) 
'Lastmodifieddate = objFile.DateLastModified 

Const ForAppending = 8 
Set outputFile = objFSO.OpenTextFile(Filename, ForAppending, true)	' Open file for writing 
OutputFile.WriteLine strHostname & "," & strUUID & "," & strMAC'Write filename and last modified date to output file 
OutputFile.Close 
'End If 
set objFSO = Nothing 

Share this post


Link to post
Share on other sites

  • 0

Hi, thanks for all the excellent info. I was just on ph with MS ( yes of all people!) okay they are telling me ' oh no you mean 'Unknown Computers & etc....' and I am like NO I do not mean Unknown Computers....I don't use Unknown Computers....duuuuh! am I missing something here? I use a csv import and do an SCCM Flash /CD boot...they are not Unknown!...Not only these guys but the SCCM guy on site....I had some problems with this Unknown Computer thing....anyway....and I would rather continue using the import csv....tnks....I had to verify someone else has done this.....

 

AlephNull..

Share this post


Link to post
Share on other sites

  • 0

hi all,

we are working on replace scenario currently & have imported few xp & win 7 machines in different collections using CSV files.

the only part we are stuck is on the association of these machine ,we don't want to do it manually we want to have an automated process which does this work so that after the machine association we can run the Replace TS.

Can we do this in SCCM 2007 or do we need scripts for this process.

Thanks

Pranay.

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.