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

  • 问题

  • 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

    2012年9月27日 10:43

答案

  • 您好! 

            

    我们发现您在其他版块中也发了一个内容非常相近的帖子,我们将在那个帖子中针对您的问题进行回复。

    谢谢您的配合。


    如果您对我们的论坛在线支持服务有任何的意见或建议,请通过邮件告诉我们。
    Description: Description: TechNet 论坛好帮手立刻免费下载  TechNet 论坛好帮手

    2012年9月28日 8:53
    版主