View all devices recorded by WDS
WDSUTIL /Get-AllDevices
View the list of devices pending approval
WDSUTIL /Get-AutoAddDevices /DeviceType:PendingDevices
View the list of devices already approved
WDSUTIL /Get-AutoAddDevices /DeviceType:ApprovedDevices
View the list of devices rejected
WDSUTIL /Get-AutoAddDevices /DeviceType:RejecteddDevices
To approve a computer (whether it is pending or not)
WDSUTIL /Add-Device /Device:<hostname of your choice> /id:<MAC in xx-xx-xx-.. format> /BootImagePath:Boot\x64\Images\win2008r2.wim /WDSClientUnattend:My_unattent_file_in_bootimagepath.xml
If the machine has already been approved you can replace
/Add-Device
with
/Set-Device
and execute the same command.
IMPORTANTTo avoid boot loops in a fully automated environment, set PXE policy to known-clients require F12 and always continue to boot for unknown-clients.
Then for PXE response, set to response to all clients (known and unknown) and check require administrator approval to unknown computers.
Use the above /add-device method (instead of /approve-autoadddevices) when the box appears in the pending list. This will approve the box for installation
but doesn't add the server to approved list. After the server is fully installed you can make the box unknown again by rejecting the server with /reject-autoadddevices and then deleting the reject list (also don't forget to remove the server from AD by running:
net computer \\<name of server> /del
The reason for this is that WDS has the limitation of not letting you delete a single server from the approved list (you can only delete the whole list). With this
limitation, the only way you can make a single server "unknown" to make it eligible for AP again (without messing up the state of other installations in progress)
is to never add the server to approved list (so avoid using /approve-autoadddevices).
To approve a pending computer using
/Approve-AutoAddDevices
WDSUTIL
/Approve-AutoAddDevices /RequestID:<ID> /MachineName:<hostname
of your choice> /WDSClientUnattend:<unattent.xml which you have
prepared>
All possible options for approval:
* To change the name, specify /MachineName:<name>
* To change the organizational unit (OU) where the account will be created, specify /OU:<name of OU>.
* To change the user account for the domain join, specify /User:<name> where the name is domain\user or user@domain.
* To enable the user to join this computer to the domain only once, specify /JoinRights:JoinOnly.
* To enable the user to join this computer to the domain at any time, specify /JoinRights:Full.
* To join this computer to the domain, specify /JoinDomain:Yes.
* To direct the computer to install from a different Windows Deployment
Services server, specify /ReferralServer:<server name>.
* To change the network boot program used, specify /BootProgram:<path>.
* To change the unattend file used for the Microsoft Windows
Preinstallation Environment (Windows PE) phase of unattended setup,
specify /WDSClientUnattend:<path>.
* To change the boot image used, specify /BootImagePath:<path>.
Approval for Linux, where pxelinux.com is download from syslinux
WDSUTIL /Approve-AutoAddDevices /RequestID:<ID> /bootprogram:boot\x86\pxelinux.com
Choose the server's default unattend file:
WDSUTIL /Set-Server /WDSUnattend /Policy:Enabled /File:<path> /Architecture:{x86|x64|ia64}
To prestage a client computer to use an unattend file other than the default for the Windows PE phase of unattended setup
WDSUTIL
/Set-Device /Device:<name> /WDSClientUnattend:<path>
(where the path is relative to the unattend file you want from the
RemoteInstall folder.)
----
To change the message displayed to pending computers
WDSUTIL /Set-Server /AutoAddPolicy /Message:<message>
---
to delete known hosts:
NET COMPUTER \\computername {/ADD | /DEL}
WDSUTIL /Delete-AutoAddDevices /DeviceType:ApprovedDevices
WDSUTIL /Delete-AutoAddDevices /DeviceType:PendingDevices
WDSUTIL /Delete-AutoAddDevices /DeviceType:RejectedDevices
to get a list:
wdsutil /get-autoadddevices /devicetype:approveddevices
wdsutil /get-autoadddevices /devicetype:pendingdevices
wdsutil /get-autoadddevices /devicetype:rejecteddevices
----------
To prestage a client computer to use a boot image other than the default
WDSUTIL
/Set-Device /Device:<name> /BootImagePath:<path>
(where <path> is the relative path to the boot image you want from
the RemoteInstall folder.)
#### RUN THESE ON THE SERVER FOR THE AP INITIAL SETUP #####
configure
the pxe boot policy so known clients require the user to press f12 and
unknown clients always continue to pxe boot (using the wds mmc). Then
run:
WDSUTIL /Set-Server /pxepromptpolicy /new:noprompt
WDSUTIL /Set-Server /pxepromptpolicy /known:optout
wdsutil /set-server /bootprogram:boot\x86\abortpxe.com /architecture:x86
WDS Image Capturing
To make a capture, one needs to execute sysprep on the target system first.
Windows 2008
%systemroot%\system32\sysprep\sysprep.exe /quiet /generalize /oobe /quit
Windows 2008r2
C:\Windows\System32\sysprep\sysprep.exe /quiet /generalize /oobe /quit
window 2003
sysprep.exe /reseal /reboot
boot menu selection timeout
When you have multiple valid boot images enabled the boot image specified by the "/bootimaepath:" flag is selected by default example:
wdsutil /approve-autoadddevices /requestid:100 /machiename:test /bootimagepath:boot\x86\Images\win2008_capture.wim
You can lower the countdown time of the boot menu for faster selection:
bcdedit /timeout 0 /store c:\remoteinstall\boot\x86\default.bcd
bcdedit /timeout 0 /store c:\remoteinstall\boot\x64\default.bcd
wdsutil /stop-server
wdsutil /start-server
Look at the boot options:
bcdedit /enum all /store c:\remoteinstall\boot\x86\default.bcd
Injecting 32bit NIC driver into win2008x86 boot.wim
You will need to install Microsoft Windows AIK. After installation execute Windows PE Tools Command Prompt from start menu.
run the following commands from the command prompt:
switch to c:\program files\windows aik\tools\x86
then run:
C:\Program Files\Windows AIK\Tools\x86>imagex /info c:\kr2\win2008_setup.wim
Get the index number of the boot image then run (where 2 here is the index of the boot image in this case)
C:\Program Files\Windows AIK\Tools\x86>imagex /mountrw c:\kr2\win2008_setup.wim 2 c:\kr2\mount
C:\Program Files\Windows AIK\Tools\x86>peimg /inf="C:\kr2\driver\Bcom\W2K3_8\NX2_W2K3_8_RIS_Drivers\b06nd51\b06nd.inf" c:\kr2\mount\Windows
C:\Program Files\Windows AIK\Tools\x86>imagex /unmount /commit c:\kr2\mount