Quantcast
Channel: Microsoft Deployment Toolkit forum
Viewing all articles
Browse latest Browse all 11297

Please:How to inject the two file into OS Deplyment Task sequence in intended order?

$
0
0

Please:How to inject the two file into OS Deplyment Task sequence?

In My bootstrap.ini,I have already injected some codes to make Client computers join into domain.

How to make the two file run before client computer joining into domain?

the fuction of the  2  file is to change computer name to "PC&LAN adapter'MAC".

for Windows 7,the task sequence may be  start task sequence--->run the two file to change Client compter's name--->joining into domain


Otherwise,for Windows XP系统,cause windows XP must install powershell component first, so that the .ps1 file could run correctly,

so,please tell me :for the XP deployment,how to make the sequence :  start task sequence--->Installing Powershell component--->run the two files--->joining domain


BTW:run 01.cmd first ,02.ps1 second。

01.cmd is below

ftype Microsoft.PowerShellScript.1="%SystemRoot%\system32\windowspowershell\v1.0\powershell.exe" ".\"%1""
"%SystemRoot%\system32\windowspowershell\v1.0\powershell.exe" set-executionpolicy remotesigned

02.ps1 is below

$netid=gwmi Win32_NetworkAdapter |?{$_.NetConnectionStatus}| Select-Object DeviceID 
$network=ForEach ($id in $netid ){gwmi Win32_NetworkAdapterConfiguration|? {$_.index -eq $id.DeviceID -and $_.DefaultIPGateway -ne $null}}
$hostname="PC"+($network.MACAddress.split(":") -join $null)
set-itemproperty -path HKLM:\System\CurrentControlSet\Control\ComputerName\ActiveComputerName -name "ComputerName" -value $hostname
set-itemproperty -path HKLM:\System\CurrentControlSet\Services\Tcpip\Parameters -name "NV Hostname" -value $hostname
set-itemproperty -path HKLM:\System\CurrentControlSet\Services\Tcpip\Parameters -name "Hostname" -value $hostname


Viewing all articles
Browse latest Browse all 11297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>