The example uses the advanced search to find items of the specified item type.




Code Sample


# Get the default search criteria.

$criteria = $xia.GET_DefaultSearchCriteria();


# Configure the criteria.

$criteria.SearchString = "*";

$criteria.Filters.Type = "WindowsServer";


# Perform the search.

$searchResults = $xia.DO_PerformSearch($criteria)

foreach ($searchResult in $searchResults.SearchResult) 

{

    Write-Host "Located $($searchResult.Name) [$($searchResult.ItemID)]";