The Remove-WdsClient cmdlet removes a pre-staged client from Active Directory® Domain Services (AD DS) or the stand-alone server device database, or clears the Pending Devices database.
To remove pre-staged client from AD DS, specify the name of the computer or the device ID, which is a GUID, media access control (MAC) address, or Dynamic Host Configuration Protocol (DHCP) identifier associated with the computer.
You can specify a client within AD DS domain of the server that runs Windows Deployment Services, in a specified domain, or anywhere in the current AD DS forest.
To clear the Pending Devices database, specify whether to remove devices that are approved, denied, or pending.
Examples
Example 1: Remove a device by using its ID from a specified domain
This command removes pre-staged devices that have a pending status of Approved.
Because the command does not specify the Domain parameter or the SearchForest parameter, it removes devices only in the local domain.
Parameters
-AsJob
Runs the cmdlet as a background job.
Use this parameter to run commands that take a long time to complete.
The cmdlet immediately returns an object that represents the job and then displays the command prompt.
You can continue to work in the session while the job completes.
To manage the job, use the *-Job cmdlets.
To get the job results, use the Receive-Job cmdlet.
For more information about Windows PowerShell® background jobs, see about_Jobs.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CimSession
Runs the cmdlet in a remote session or on a remote computer.
Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet.
The default is the current session on the local computer.
Parameter properties
Type:
CimSession[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
Session
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DeviceID
Specifies the ID of the computer.
This identifier is the GUID of a network adapter, a MAC address, or a DHCP unique identifier associated with the computer.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
PrestagedClientByDeviceIdSearchForest
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
PrestagedClientByDeviceIdDomain
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
PrestagedClientByDeviceId
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-DeviceName
Specifies the name of the computer associated with the pre-staged client.
This is a sAMAccountName value.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
PrestagedClientByDeviceName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
PrestagedClientByDeviceNameDomain
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
PrestagedClientByDeviceNameSearchForest
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-Domain
Indicates that the cmdlet refers to pre-staged clients in the domain specified by the DomainName parameter, instead of the domain of the server that runs Windows Deployment Services or the whole forest.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
PrestagedClientByDeviceIdDomain
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
PrestagedClientByDeviceNameDomain
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DomainName
Specifies a domain name.
Specify a value for this parameter only if you specify the Domain parameter.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
PrestagedClientByDeviceIdDomain
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
PrestagedClientByDeviceNameDomain
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-PendingClientStatus
Specifies a pending client status.
The acceptable values for this parameter are:
Any
Approved
Denied
Pending
Parameter properties
Type:
PendingClientStatusFlag
Default value:
None
Accepted values:
Pending, Approved, Denied, Any
Supports wildcards:
False
DontShow:
False
Parameter sets
PendingClientByStatus
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-SearchForest
Indicates that the cmdlet refers to pre-staged devices anywhere in the current AD DS forest.
If you do not specify this parameter and do not specify the Domain parameter, the cmdlet looks for pre-staged devices in the local domain.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
PrestagedClientByDeviceIdSearchForest
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
PrestagedClientByDeviceNameSearchForest
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ThrottleLimit
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.