Jump to content




anyweb

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



Recommended Posts

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


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

no it can't you must enter the computername and MAC address or computername and GUID

 

cheers

niall

Share this post


Link to post
Share on other sites

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

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

Awesome information,

 

Is it possible to make an association with an existing PC for Side by Side Migration?

Share this post


Link to post
Share on other sites

Can this be done via vbscript or hta? I have certain folks that need to image bare metal systems, but I don't want them on my SCCM server or in the SCCM console.

Share this post


Link to post
Share on other sites

Is it possible to create collection and import cvs file. i wont to deploy security updates with Software Updates and i can not find how to import csv file

Share this post


Link to post
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×