Set-ExecutionPolicy Unrestricted
Import-Module –name C:\Scripts\MDTDB.psm1
Connect-MDTDatabase –sqlServer hyd-srv1 –instance ?? –database MDT
Get-MDTComputer
Name,MAC
comp1,00:11
comp2,00:22
$machines = Import-Csv C:\scripts\machines.txt
New-MDTComputer –macAddress $machines[1].mac –settings @{OSInstall='YES';OSDComputerName=$machines[1].name}
For ($i=1; $i -le $machines.count; $i++)
{
New-MDTComputer -macAddress $machines[$i-1].mac -settings @{ OSInstall='YES'; OSDComputerName=$machines[$i-1].name;}
}
Komentarze
Prześlij komentarz