ComputerPrincipal.FindByLogonTime Method

Definition

Returns a PrincipalSearchResult<T> collection of ComputerPrincipal objects that have a logon time within the specified date and time range.

public:
 static System::DirectoryServices::AccountManagement::PrincipalSearchResult<System::DirectoryServices::AccountManagement::ComputerPrincipal ^> ^ FindByLogonTime(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, DateTime time, System::DirectoryServices::AccountManagement::MatchType type);
public static System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.ComputerPrincipal> FindByLogonTime (System.DirectoryServices.AccountManagement.PrincipalContext context, DateTime time, System.DirectoryServices.AccountManagement.MatchType type);
static member FindByLogonTime : System.DirectoryServices.AccountManagement.PrincipalContext * DateTime * System.DirectoryServices.AccountManagement.MatchType -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.ComputerPrincipal>
Public Shared Function FindByLogonTime (context As PrincipalContext, time As DateTime, type As MatchType) As PrincipalSearchResult(Of ComputerPrincipal)

Parameters

context
PrincipalContext

The PrincipalContext that specifies the server or domain against which operations are performed.

time
DateTime

A DateTime structure that is used in conjunction with the MatchType to filter search results.

type
MatchType

The MatchType that specifies the type of comparison to use in the search.

Returns

A PrincipalSearchResult<T> that contains one or more ComputerPrincipal objects that match the search parameters, or an empty collection if no matches are found.

Remarks

The time will default to UTC. If you want to specify the time in local time, then specify the Kind property of the time object as Local.

Applies to