-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Documentation update Get-PnPUnifiedAuditLog Start and end times should be UTC Dates. #3753
Comments
@reshmee011 - can you check this since you recently worked on some improvements around this ? When we first created this cmdlet, we didn't require dates to be in UTC , but maybe things have changed ? |
@gautamdsheth , that's right the date and times need to be in UTC, I discovered it while working with cli for m365 equivalent as the dates are being passed as string and needed to be formatted to ISO 8601 string (2024-02-16) The PnP PowerShell accepts date parameters , hence conversion not required. Worth mentioning the required format. |
@reshmee011 - thanks for confirming ! Could you also please update the PR as well to mention this ? :) |
@gautamdsheth : I have updated the PR to include the note about passing the start and end date in ISO 8601 format if passed as string format. |
Thanks @SPDEVGUY and @reshmee011 , docs updated. Closing this. |
@gautamdsheth / @reshmee011
In order to get the actual latest entries (which my app follows in 5 min slices) I needed to use the utc time now less 5 mins to actually get things that happened in the last 5 minutes. You could probably just make this clear by changing your example to include " -asUtc"
|
I apologize for any inconvenience caused by the oversight. As I am based in the UK and use GMT, I didn’t fully appreciate the impact of non-UTC dates. Thank you for bringing this to my attention! 😊. I have submitted a PR to update the docs. |
Reporting an Issue or Missing Feature
Bug (Documentation incorrect)
https://pnp.github.io/powershell/cmdlets/Get-PnPUnifiedAuditLog.html
Example 1
Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date).AddDays(-2) -EndTime (Get-Date).AddDays(-1)
Expected behavior
Documentation is missing the fact that start and end times are UTC.
Actual behavior
Example 1 should be like this and Start and End times documentation should make note that dates provided are UTC times.
The text was updated successfully, but these errors were encountered: