ComputerPrincipal.FindByLogonTime(PrincipalContext, DateTime, MatchType) 方法
定义
返回 PrincipalSearchResult<T> 对象的 ComputerPrincipal 集合,这些对象在指定的日期和时间范围内进行过登录。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)
参数
- context
- PrincipalContext
PrincipalContext,用于指定要对其执行操作的服务器或域。The PrincipalContext that specifies the server or domain against which operations are performed.
- time
- DateTime
一个 DateTime 结构,与 MatchType 一起用于筛选搜索结果。A DateTime structure that is used in conjunction with the MatchType to filter search results.
- type
- MatchType
一个 MatchType,用于指定要在搜索中使用的比较类型。The MatchType that specifies the type of comparison to use in the search.
返回
一个 PrincipalSearchResult<T>,其中包含一个或多个匹配搜索参数的 ComputerPrincipal 对象,如果未找到匹配项,则为一个空集合。A PrincipalSearchResult<T> that contains one or more ComputerPrincipal objects that match the search parameters, or an empty collection if no matches are found.
注解
此时间将默认为 UTC。The time will default to UTC. 如果要以本地时间指定时间,请将对象的属性指定 Kind time 为 Local 。If you want to specify the time in local time, then specify the Kind property of the time object as Local.