Searches for computers by querying Active Directory, and returns the computer objects.
Description
Searches for one or more computers by querying Active Directory, and returns the computer objects.
You can use this cmdlet to query Active Directory for computers based on specified criteria, or a combination of criteria, including:
- The fully qualified domain name (FQDN) of a computer
- All or part of the computer name
- The name of a domain
- All computers except hosts managed by Virtual Machine Manager
- All computers except library servers managed by Virtual Machine Manager
- Only Hyper-V hosts
- Bare-metal computers that have out-of-band controllers
NOTE: If you add a new computer (such as a host or library server) located in an Active Directory domain to System Center Virtual Machine Manager (VMM) and then immediately run the Discover-Computer cmdlet, the cmdlet might not immediately discover the new computer when it searches Active Directory. This delay may occur because data about the new computer might not have replicated yet across the Active Directory domain. If you are a Domain Administrator, you can use the Active Directory Sites and Services console to force the data to replicate immediately.
For more information about Find-SCComputer, type: "Get-Help Find-SCComputer -online".
Parameters
BMCProtocol
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the protocol that VMM uses to communicate with the out-of-band baseboard management controller (BMC). Valid values are: IPMI, SMASH, iLO, Custom.
A BMC (also known as a service processor or management controller) is a specialized controller on the motherboard of a server that acts an interface between the hardware and system management software. If the motherboard of a physical machine includes a BMC, when the machine is plugged in (whether it is powered off or powered on, and whether or not an operating system is installed), information about system hardware and the state of that system hardware health is available.
Example format: -BMCProtocol “Custom”
NOTE: The Custom protocol requires using the BMCCustomCondigurationProvider.
BMCRunAsAccount
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies the Run As account to use with the baseboard management controller (BMC) device.
IPAddressRangeEnd
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies the last IP address in a range of IP addresses. Use with IPAddressRangeStart.
IPAddressRangeStart
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies the first IP address in a range of IP addresses. Use with IPAddressRangeEnd.
All
Required?
false
Accept Pipeline Input?
false
Position?
named
Retrieves a full list of all subordinate objects independent of the parent object. For example, the command Get-SCVirtualDiskDrive -All retrieves all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.
BMCCustomConfigurationProvider
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, a configuration provider object for a baseboard management controller (BMC). A configuration provider is a plug-in to VMM that translates VMM PowerShell commands to API calls that are specific to a type of baseboard management controller. This parameter should be used with the Custom BMCProtocol.
BMCPort
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the out-of-band baseboard management controller (BMC) port for a specific physical machine. A BMC port is also known as a service processor port. Example default ports are 623 for IPMI and 443 for SMASH over WS-Man.
Example format: -BMCPort 80
DiscoveryID
Required?
false
Accept Pipeline Input?
false
Position?
named
For internal use only (not for use in your code).
JobVariable
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies that job progress is tracked and stored in the variable named by this parameter.
RunAsynchronously
Required?
false
Accept Pipeline Input?
false
Position?
named
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
VMMServer
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies a VMM server object.
BMCProtocol
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the protocol that VMM uses to communicate with the out-of-band baseboard management controller (BMC). Valid values are: IPMI, SMASH, iLO, Custom.
A BMC (also known as a service processor or management controller) is a specialized controller on the motherboard of a server that acts an interface between the hardware and system management software. If the motherboard of a physical machine includes a BMC, when the machine is plugged in (whether it is powered off or powered on, and whether or not an operating system is installed), information about system hardware and the state of that system hardware health is available.
Example format: -BMCProtocol “Custom”
NOTE: The Custom protocol requires using the BMCCustomCondigurationProvider.
BMCRunAsAccount
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies the Run As account to use with the baseboard management controller (BMC) device.
Subnet
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies an IP subnet (IPv4 or IPv6) in Classless Inter-Domain Routing (CIDR) notation.
Example format for an IPv4 subnet: 192.168.0.1/24
Example format for an IPv6 subnet: FD4A:29CD:184F:3A2C::/64
NOTE: An IP subnet cannot overlap with any other subnet in a host group or child host groups.
All
Required?
false
Accept Pipeline Input?
false
Position?
named
Retrieves a full list of all subordinate objects independent of the parent object. For example, the command Get-SCVirtualDiskDrive -All retrieves all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.
BMCCustomConfigurationProvider
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, a configuration provider object for a baseboard management controller (BMC). A configuration provider is a plug-in to VMM that translates VMM PowerShell commands to API calls that are specific to a type of baseboard management controller. This parameter should be used with the Custom BMCProtocol.
BMCPort
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the out-of-band baseboard management controller (BMC) port for a specific physical machine. A BMC port is also known as a service processor port. Example default ports are 623 for IPMI and 443 for SMASH over WS-Man.
Example format: -BMCPort 80
DiscoveryID
Required?
false
Accept Pipeline Input?
false
Position?
named
For internal use only (not for use in your code).
JobVariable
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies that job progress is tracked and stored in the variable named by this parameter.
RunAsynchronously
Required?
false
Accept Pipeline Input?
false
Position?
named
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
VMMServer
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies a VMM server object.
ADSearchFilter
Required?
true
Accept Pipeline Input?
false
Position?
named
Defines an Active Directory query for discovery. Use this parameter to specify a query that contains Active Directory domain information and search filters.
Example format: -ADSearchFilter "(&(sAMAccountType=805306369)(name=katarina*)(objectCategory=computer)(objectClass =computer)(operatingSystem=Windows\20Server*))"
Credential
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.
For more information about the PSCredential object, type: "Get-Help Get-Credential".
For more information about Run As accounts, type: "Get-Help New-SCRunAsAccount".
Domain
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies a fully qualified domain name (FQDN) for an Active Directory domain.
Example format: -Domain "Domain01.Corp.Contoso.com"
DiscoveryID
Required?
false
Accept Pipeline Input?
false
Position?
named
For internal use only (not for use in your code).
ExcludeVMMHost
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes virtual machine hosts currently managed by VMM.
ExcludeVMMLibrary
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes library servers currently managed by VMM.
ExcludeVMs
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes virtual machines.
FindHyperVHost
Required?
false
Accept Pipeline Input?
false
Position?
named
Searches for computers running Windows Server 2008 or later on which the Hyper-V server role is enabled.
JobVariable
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies that job progress is tracked and stored in the variable named by this parameter.
RunAsynchronously
Required?
false
Accept Pipeline Input?
false
Position?
named
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
VMMServer
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies a VMM server object.
Credential
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.
For more information about the PSCredential object, type: "Get-Help Get-Credential".
For more information about Run As accounts, type: "Get-Help New-SCRunAsAccount".
Domain
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies a fully qualified domain name (FQDN) for an Active Directory domain.
Example format: -Domain "Domain01.Corp.Contoso.com"
ComputerNameFilter
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies the partial or full name of a computer that the cmdlet will try to discover in Active Directory.
Example format: -ComputerNameFilter "host"
DiscoveryID
Required?
false
Accept Pipeline Input?
false
Position?
named
For internal use only (not for use in your code).
ExcludeVMMHost
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes virtual machine hosts currently managed by VMM.
ExcludeVMMLibrary
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes library servers currently managed by VMM.
ExcludeVMs
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes virtual machines.
FindHyperVHost
Required?
false
Accept Pipeline Input?
false
Position?
named
Searches for computers running Windows Server 2008 or later on which the Hyper-V server role is enabled.
JobVariable
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies that job progress is tracked and stored in the variable named by this parameter.
RunAsynchronously
Required?
false
Accept Pipeline Input?
false
Position?
named
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
VMMServer
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies a VMM server object.
BMCAddress
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the out-of-band baseboard management controller (BMC) address for a specific physical machine. This might be an IP address, the fully qualified domain name (FQDN), or the DNS prefix (which is usually the same name as the NetBIOS name).
Typically, the BMC address and its connection to the network are separate from the IP address associated with a standard network adapter. Alternatively, some computers do use a standard network adapter to provide a single address for the BMC and for the network adapter. However, the BMC address has a unique port and is thus uniquely identifiable on the network.
Example IPv4 format: -BMCAddress “10.0.0.21”
Example Ipv6 format: -BMCAddress “2001:4898:2a:3:657b:9c7a:e1f0:6829”
Example FQDN format: -BMCAddress “Computer01.Contoso.com”
Example NetBIOS format: -BMCAddress “Computer01”
NOTE: By default, VMM uses an IP address or FQDN for the BMCAddress. However, it is also possible to create a Windows PowerShell module that enables you to specify other types of addresses as the BMC address.
BMCProtocol
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the protocol that VMM uses to communicate with the out-of-band baseboard management controller (BMC). Valid values are: IPMI, SMASH, iLO, Custom.
A BMC (also known as a service processor or management controller) is a specialized controller on the motherboard of a server that acts an interface between the hardware and system management software. If the motherboard of a physical machine includes a BMC, when the machine is plugged in (whether it is powered off or powered on, and whether or not an operating system is installed), information about system hardware and the state of that system hardware health is available.
Example format: -BMCProtocol “Custom”
NOTE: The Custom protocol requires using the BMCCustomCondigurationProvider.
BMCRunAsAccount
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies the Run As account to use with the baseboard management controller (BMC) device.
BMCCustomConfigurationProvider
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, a configuration provider object for a baseboard management controller (BMC). A configuration provider is a plug-in to VMM that translates VMM PowerShell commands to API calls that are specific to a type of baseboard management controller. This parameter should be used with the Custom BMCProtocol.
BMCPort
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies, or updates, the out-of-band baseboard management controller (BMC) port for a specific physical machine. A BMC port is also known as a service processor port. Example default ports are 623 for IPMI and 443 for SMASH over WS-Man.
Example format: -BMCPort 80
VMMServer
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies a VMM server object.
ComputerName
Required?
true
Accept Pipeline Input?
false
Position?
0
Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are: FQDN, IPv4 or IPv6 address, or NetBIOS name.
NOTE: See the examples for a specific cmdlet to determine how that cmdlet specifies the computer name.
Credential
Required?
true
Accept Pipeline Input?
false
Position?
named
Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.
For more information about the PSCredential object, type: "Get-Help Get-Credential".
For more information about Run As accounts, type: "Get-Help New-SCRunAsAccount".
DiscoveryID
Required?
false
Accept Pipeline Input?
false
Position?
named
For internal use only (not for use in your code).
ExcludeVMMHost
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes virtual machine hosts currently managed by VMM.
ExcludeVMMLibrary
Required?
false
Accept Pipeline Input?
false
Position?
named
Excludes library servers currently managed by VMM.
RunAsynchronously
Required?
false
Accept Pipeline Input?
false
Position?
named
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
VMMServer
Required?
false
Accept Pipeline Input?
false
Position?
named
Specifies a VMM server object.
Examples
1: Search for computers in a specific
domain that meet the specified criteria.
The first command gets the Run As account object named Host Computer Account 01 and stores the object in the $RunAsAccount variable.
The second command queries Active Directory and returns a list of Hyper-V computer objects for computers that are located in the Contoso.com domain, that have a name starting with "host", and that are not managed by VMM. As this command is processed, $RunAsAccount provides credentials to Find-SCComputer.
NOTE: When you use Find-SCComputer with the Domain parameter, you must specify the fully qualified domain name.
2: Search for a specific computer by
name and validate its properties in Active Directory.
This command uses the fully qualified domain name (FQDN) of the computer named VMHost01 to find this computer in Active Directory, returns the computer object, and displays the computer object properties to the user.
3: Search for all computers in the
specified domain that are not a VMM library server.
The first command gets the Run As account object named Host Computer Account 01 and stores the object in the $RunAsAccount variable.
The second command queries Active Directory for all computers in the Contoso.com domain that include "vmm" in the computer name except for VMM library servers. As this command is processed, $RunAsAccount provides credentials to Find-SCComputer.
4: Find all unmanaged computers in the
specified domain by using an Active Directory query.
The first command gets the Run As account object named Host Computer Account 01 and stores the object in the $RunAsAccount variable.
The second command queries Active Directory for all computers in the Contoso.com domain that meet the query criteria: any Windows Server 2008 R2 computer with a name that starts with Test0 but which are not VMM library servers or VMM hosts. As this command is processed, $RunAsAccount provides credentials to Find-SCComputer.
5: Find bare-metal computers that have
out-of-band controllers that are within a specific network
range.
The first command gets the Run As account object named BMC Account 01 and stores the object in the $BMCRunAsAccount variable.
The second command scans the network for a physical computer with the specified BMCAddress. As this command is processed, $BMCRunAsAccount provides credentials to Find-SCComputer.