Gets log records from the Milestone XProtect Log Server.
This cmdlet uses
[VideoOS.Platform.Log.LogClient]::Instance to read logs of
the specified LogType. The log entries available are the same as the logs
available in Management Client, and do not include individual component logs
such as you will find in C:\ProgramData\Milestone*.
The LogClient implementation in MIP SDK can result in exponentially slower read performance when requesting logs over a long time span, so this cmdlet uses a "windowing" strategy to break up the given range of time between StartTime and EndTime. Initially, each request for logs uses a 10-minute range. If the number of log entries in that 10-minute span of time is less than 500, the size of the window will be increased in 5-minute increments.
If the number of log entries in a given period exceed 2000, then the window will be adjusted down so that the next request contains closer to 1000 entries. The minimum window size is 1 minute, and the maximum is 60 minutes.
- Requires VMS connection and will attempt to connect automatically
Connect-ManagementServer -ShowDialog -AcceptEula Get-VmsLog -LogType Audit -StartTime (Get-Date).Date.AddDays(-1) -EndTime (Get-Date).Date <# OUTPUT Local time : 1/31/2022 11:40:26 AM Message text : User has accessed logs. Log type: Audit Time: 2022-01-28 21:00:41 to 2022-01-28 21:01:41 (UTC time) Permission : Granted Category : Log read Source type : Audit Source name : User : [BASIC]\DEMO User location : 184.108.40.206 #>
Login to a Management Server using the login dialog, and then retrieve all audit logs from the previous day, from midnight of the previous day to midnight of today.
Without any parameters, the default behavior is to return the last 24 hours of log entries from the System log.
Returns the last 90 minutes of audit logs.
The culture value determines the language of logs returned by the MIP SDK LogClient. The default value should be "System.Globalization.CultureInfo.CurrentCulture.Name" and any alternative can be provided. If translations are not available for the language associated with the provided culture, then the logs will be returned in english.
Specifies the end of the time range from which logs should be returned.
Specifies the type of log entry requested.
Specifies the number of minutes to go back for the most recent logs. The logs returned will reflect all log entries between "Minutes" ago, and "now".
Specifies the start of the time range from which logs should be returned. Default value is [DateTime]::Now.AddHours(-24).
Specifies that the "tail", or the most recent entries from the specified log should be returned. The StartTime for the request is determined by subtracting the value specified by "Minutes" from [DateTime]::Now.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.