diff --git a/CHANGELOG.md b/CHANGELOG.md
index a0583ee79..a7abc1c9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Updated `Get/Set-PnPSearchSettings` with an option `-SearchBoxPlaceholderText` to set search placeholder text for the SPO nav bar search box
- Added Set-PnPTermGroup cmdlet to update an existing taxonomy term group.
- Added Set-PnPTeamifyPromptHidden to hide the teamify prompt on a group connected Team Site (modern team site)
+- Added Get-PnPSiteHistoricalVersionsStatus to get information about the Historical Versions feature, a feature that makes past versions of documents searchable for eDiscovery when enabled
### Changed
- Changed the client id of the application used behind the scenes when authenticating to a tenant where Legacy Authentication has been turned off. We now by default utilize the PnP Management Shell application. If you have not provided consent you will be prompted with a message on how to provide consent.
diff --git a/Commands/PnP.PowerShell.Commands.csproj b/Commands/PnP.PowerShell.Commands.csproj
index a86bc9ef1..3498d2a94 100644
--- a/Commands/PnP.PowerShell.Commands.csproj
+++ b/Commands/PnP.PowerShell.Commands.csproj
@@ -806,6 +806,7 @@
+
diff --git a/Commands/Search/GetSiteHistoricalVersionsStatus.cs b/Commands/Search/GetSiteHistoricalVersionsStatus.cs
new file mode 100644
index 000000000..746bdf1f8
--- /dev/null
+++ b/Commands/Search/GetSiteHistoricalVersionsStatus.cs
@@ -0,0 +1,56 @@
+#if !ONPREMISES
+using System.Collections.Generic;
+using System.Management.Automation;
+using Microsoft.SharePoint.Client;
+using Microsoft.SharePoint.Client.Search.Administration;
+using PnP.PowerShell.CmdletHelpAttributes;
+
+namespace PnP.PowerShell.Commands.Search
+{
+ [Cmdlet(VerbsCommon.Get, "PnPSiteHistoricalVersionsStatus")]
+ [CmdletHelp("Returns summary crawl info about the Historical Versions feature for the current site collection from the context. " +
+ "This is a feature that makes past versions of documents searchable for eDiscovery when enabled.",
+ SupportedPlatform = CmdletSupportedPlatform.Online,
+ Category = CmdletHelpCategory.Search)]
+ [CmdletExample(
+ Code = @"PS:> Get-PnPSiteHistoricalVersionsStatus",
+ Remarks = "Returns the count of documents with historical versions processed and the count of total documents with versions enabled on the site, as well as when these counts will be next updated (all times in UTC).",
+ SortOrder = 1)]
+ public class GetSiteHistoricalVersionsStatus : PnPWebCmdlet
+ {
+
+ protected override void ExecuteCmdlet()
+ {
+ var siteLog = new SiteCrawlLog(ClientContext, ClientContext.Site);
+ ClientContext.Load(siteLog);
+
+ var resultTable = siteLog.GetHistoricalVersionsStatus();
+ ClientContext.ExecuteQueryRetry();
+
+ if (resultTable.Value == null || resultTable.Value.Rows.Count == 0)
+ {
+ WriteWarning("No information was obtained for the current site");
+ }
+ else
+ {
+ // The API should only return 1 row
+ WriteObject(ConvertToPSObject(resultTable.Value.Rows[0]));
+ }
+
+ }
+
+ private object ConvertToPSObject(IDictionary r)
+ {
+ PSObject res = new PSObject();
+ if (r != null)
+ {
+ foreach (var kvp in r)
+ {
+ res.Properties.Add(new PSNoteProperty(kvp.Key, kvp.Value));
+ }
+ }
+ return res;
+ }
+ }
+}
+#endif