Jump to content

Recommended Posts

Posted

I am trying to bulk populate the MDT Database. I have followed Mitch Tullochs article here ;

 

Deploying Windows 7 - Part 22: Bulk Populating the MDT Database Using PowerShell :: Windows 7 :: Articles & Tutorials :: WindowsNetworking.com

 

but this doesnt populate the description field. I would like to populate the description field with the computer name. I tried following this ;

 

http://www.edugeek.net/forums/o-s-deployment/105327-bulk-import-computers-mdt-2012-a.html

 

but couldnt get it running it said "Description" was invalid.

 

Can anyone give me a sample script to populate mac address, computer name and description?

Posted
Would you mind posting your relevant code so we can take a look?

 

Here it is - I have no idea what I am doing with Powershell but I tried to follow those articles mentioned above.

 

Import-Module –name C:\Scripts\MDTDB.psm1

 

Connect-MDTDatabase –sqlServer MDT –instance SQLEXPRESS –database MDT

 

$machines = Import-Csv C:\scripts\machines.csv

 

For ($i=1; $i -le $machines.count; $i++)

 

{

 

New-MDTComputer -macAddress $machines[$i-1].mac -settings @{

 

OSInstall='YES';

 

OSDComputerName=$machines[$i-1].name;

Description=$machines[$i-1.name;

 

 

OrgName='myschool'

 

}

 

}

Posted

The description doesn't go in the settings.

From Boardguy (via the link you provided) New-MDTComputer -macAddress $machines[$i].mac -description $machines[$i].name -settings @{

 

So your modified code would look:

[color=#333333]Import-Module –name C:\Scripts\MDTDB.psm1[/color]

[color=#333333]Connect-MDTDatabase –sqlServer MDT –instance SQLEXPRESS –database MDT[/color]

[color=#333333]$machines = Import-Csv C:\scripts\machines.csv[/color]

[color=#333333]For ($i=1; $i -le $machines.count; $i++)[/color]

[color=#333333]{[/color]

[color=#333333]New-MDTComputer -macAddress $machines[$i-1].mac [/color][color=#333333]-description $machines[$i-1].name [/color][color=#333333]-settings @{[/color]

[color=#333333]OSInstall='YES';[/color]

[color=#333333]OSDComputerName=$machines[$i-1].name;[/color]

[color=#333333]OrgName='myschool'[/color]

[color=#333333]}[/color]

[color=#333333]}[/color]

  • Thanks 1
Posted
The description doesn't go in the settings.

From Boardguy (via the link you provided) New-MDTComputer -macAddress $machines[$i].mac -description $machines[$i].name -settings @{

 

 

Thanks - Will give that a go

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



×
×
  • Create New...