22.2 Find-DRADeletedObjects

Synopsis

Searches for deleted DRA objects in the DRA Recycle Bin on the specified server.

Syntax

Find-DRADeletedObjects [-ComputerAndFilter <Hashtable>] [-ComputerOrFilter <Hashtable>] [-ContactAndFilter <Hashtable>] [-ContactOrFilter <Hashtable>] [-DynamicDistributionGroupAndFilter <Hashtable>] [-DynamicDistributionGroupOrFilter <Hashtable>] [-EquipmentMailboxOrFilter <Hashtable>] [-GroupAndFilter <Hashtable>] [-GroupOrFilter <Hashtable>] [-RoomMailboxOrFilter <Hashtable>] [-UserAndFilter <Hashtable>] [-UserOrFilter <Hashtable>] [-ContainerDN <String>] [-EnforceServerLimit <SwitchParameter>] [-IncludeChildContainers <SwitchParameter>] [-ObjectsPerResponse <Int32>] [-ResumeString <String>] [-Attributes <String[]>] [-DRARestServer <String>] [-DRARestPort <Int32>] [-IgnoreCertificateErrors <SwitchParameter>] [-Force <SwitchParameter>] [-Timeout <Int32>] [<CommonParameters>]

Description

Find-DRADeletedObjects asks the specified DRA Server to search for objects in the DRA recycle bins that match the specified filters. The server will return objects for which the requesting user has view object properties powers. For more information on the objects supported and using filters see the help for Find-DRAObjects. You can specify the ContainerDN parameter to search the Recycle Bin of a specific domain. If ContainerDN is not specified then all recycle bins are searched. You can also specify parameters that control the content in the response, such as the number of items to return and where to resume the search results if multiple requests are needed to retrieve all of the search results. See the examples in the help for more information.

Parameters

Attribute / Description

Parameters / Values

Required

Position

Default Value

Accept Pipeline input?

Accept wildcard characters?

ComputerAndFilter [<Hashtable>]

.The computer properties to use for searching computer objects. The properties will be combined for the search. Computers matching all listed properties will be returned.

false

named

 

true (ByPropertyName)

false

ComputerOrFilter [<Hashtable>]

The computer properties to use for searching computer objects. Computers matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

ContactAndFilter [<Hashtable>]

The contact properties to use for searching contact objects. The properties will be combined for the search. Contacts matching all listed properties will be returned.

false

named

 

true (ByPropertyName)

false

ContactOrFilter [<Hashtable>]

The contact properties to use for searching contact objects. Contacts matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

DynamicDistributionGroupAndFilter [<Hashtable>]

The dynamic distribution group properties to use when searching for dynamic distribution groups objects. The properties will be combined for the search. Dynamic distribution groups matching all listed properties will be returned.

true

named

 

true (ByPropertyName)

false

DynamicDistributionGroupOrFilter [<Hashtable>]

The dynamic distribution group properties to use when searching for domain objects. Dynamic distribution groups matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

EquipmentMailboxOrFilter [<Hashtable>]

The equipment resource mailbox properties to use when searching. Resource mailboxes matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

GroupAndFilter [<Hashtable>]

The group properties to use when searching for group objects. The properties will be combined for the search. Groups matching all listed properties will be returned.

false

named

 

true (ByPropertyName)

false

GroupOrFilter [<Hashtable>]

The group properties to use when searching for group objects. Groups matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

RoomMailboxOrFilter [<Hashtable>]

The room resource mailbox properties to use when searching for resource mailboxes. Resource mailboxes matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

UserAndFilter [<Hashtable>]

The user properties to use when searching for user objects. The properties will be combined for the search. Users matching all listed properties will be returned.

false

named

 

true (ByPropertyName)

false

UserOrFilter [<Hashtable>]

The user properties to use when searching for user objects. Users matching any of the listed properties will be returned.

false

named

 

true (ByPropertyName)

false

ContainerDN [<String>]

The full path to the container to search in distinguished name format. For example: -ContainerDN "OU=Accounting,DC=MyDomain,DC=corp".

false

named

 

false

false

EnforceServerLimit [<SwitchParameter>]

A switch parameter to indicate that the search results should be limited by the search result limit on the DRA Server. The typical server limit is 1000 items. The default is true.

false

named

 

false

false

IncludeChildContainers [<SwitchParameter>]

A switch parameter to request that the search include child containers. The default is false: only the container named in the ContainerDN parameter is searched.

false

named

 

false

false

ObjectsPerResponse [<Nullable`1>]

The number of objects to return in a response. The default is 250.

false

named

 

false

false

ResumeString [<String>]

When multiple responses are needed to return all of the search results to the client, this parameter indicates the last item returned from the server. The value of this parameter would be set using the ResumeString property from the previous set of results. The ResumeString may look like this: "CN=MYUser160,CN=Users,DC=MyDomain,DC=corp".

The EnforceServerLimit, ObjectsPerResponse, and ResumeString parameters are applicable only when the Identifier parameter is not specified.

false

named

 

false

false

Attributes [<String[]>]

An array of attributes to retrieve values for. If this parameter is missing, a default list of properties is returned.

false

named

 

true (ByPropertyName)

false

Domain <String>

The domain of the object in fqdn format. For example: mydomain.corp

true

named

 

true (ByPropertyName)

false

DRARestServer [<String>]

The name of the computer running the DRA Rest Service. The requested DRA operation will execute on this server. If the parameter is not specified, the value defaults to 'localhost'.

false

named

 

true (ByPropertyName)

false

DRARestPort [<Int32>]

The port where the DRA REST Service listens for requests. If the parameter is not specified, the value defaults to 8755.

false

named

8755

true (ByPropertyName)

false

IgnoreCertificateErrors [<SwitchParameter>]

Allows the request to bypass any SSL certificate errors, such as the InvalidOperation error that occurs when the REST Service is bound to a self-signed certificate.

false

named

 

false

false

Force [<SwitchParameter>]

Suppresses any request for user input and supplies a 'yes' response. For example: -Force with a delete request will perform the delete without presenting the confirmation request to the user.

false

named

 

false

false

Timeout [<Int32>]

The number of seconds to wait before the request to the DRA REST server times out. To specify an infinite timeout, you can set this parameter to -1.

false

named

100 seconds

true (ByPropertyName)

false

<CommonParameters>

Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see About CommonParameters.

 

 

 

 

 

NOTE:For more information, type "Get-Help Find-DRADeletedObjects -detailed". For technical information, type "Get-Help Find-DRADeletedObjects -full".

Example 22-5 1

PS C:\>Find-DRADeletedObjects -UserAndFilter @{Location="Houston";IsDisabled=$true} -ObjectsPerResponse 500 -ResumeString "CN=Accounting-DG,OU=Accounting,OU=Brasilia,OU=Parent Company,DC=MyDomain,DC=corp"

This example searches all recycle bins for disabled user accounts whose Location attribute equals 'Houston'. The server will return 500 items in the result and it will begin the results with the next item after the one listed in the ResumeString parameter. ResumeString is used when DRA finds more objects than what is specified in ObjectsPerResponse. When more data is available, the results will contain the ResumeString property that can be used to request the next page of results. The response also contains a boolean value IsSearchFinished that indicates if there are more results available on the server.

Example 22-6 2

PS C:\>Find-DRADeletedObjects -ContactOrFilter @{Location="HOU*"}-GroupOrFilter @{Location="HOU*"} -ContainerDn "DC=MyDomain,DC=corp" -ObjectsPerResponse 50
 

In this example, DRA will search the Recycle Bin for the domain MyDomain.corp for Contacts and Groups that have a Location attribute beginning with "HOU". The server should return a maximum of 50 items in the response.

Example 22-7 3

PS C:\>Find-DRADeletedObjects -ComputerAndFilter @{Location="Houston-9###";IsDisabled=$true;Department="Sales*"} 

In this example, DRA will search for computers with the following attributes: Location begins with 'Houston-9' and ends with 3 numeric digits, computer is disabled, Department begins with 'Sales'. DRA will search in all recycle bins since the ContainerDN parameter is not specified. The response will return a maximum of 250 items since the ObjectsPerResponse parameter is not specified.

Example 22-8 4

PS C:\>Find-DRADeletedObjects -GroupOrFilter @{Location="Houston-9###";Department="Sales*"} -ContainerDn "DC=MyDomain,DC=corp" -Attributes "DistinguishedName","DisplayName","Department"
 

In this example, DRA will search for groups having either Location beginning with 'Houston-9' and ending with 3 numeric digits, OR Department beginning with 'Sales'. DRA will search only in the Recycle Bin for the MyDomain.corp domain. For each group matching the filter criteria, the server will return three attributes. The response will return a maximum of 250 items since the ObjectsPerResponse parameter is not specified.