Last active
February 12, 2024 01:27
-
-
Save michaellwest/fb14d9f3e29b3a3a06e50ad5a5252492 to your computer and use it in GitHub Desktop.
Remove entries in the Sitecore Publishing Service queue using PowerShell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Function -Name Invoke-SqlCommand | |
$connection = [Sitecore.Configuration.Settings]::GetConnectionString("master") | |
$query = @" | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_ActivationLock] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_Data_Params_FieldIds] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_Data_Params_Languages] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_JobManifest] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_JobMetadata] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_JobQueue] | |
DELETE TOP(100000) FROM [Sitecore.Masterx].[dbo].[Publishing_ManifestOperationResult] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_ManifestStatus] | |
DELETE TOP(100000) FROM [Sitecore.Masterx].[dbo].[Publishing_ManifestStep] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_PublisherOperation] | |
DELETE FROM [Sitecore.Masterx].[dbo].[Publishing_TargetSyncState] | |
"@ | |
Invoke-SqlCommand -Connection $connection -Query $query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Function -Name Invoke-SqlCommand | |
$connection = [Sitecore.Configuration.Settings]::GetConnectionString("master") | |
$query = @" | |
DELETE TOP (1000) | |
FROM [dbo].[Publishing_JobQueue] | |
SELECT COUNT(*) QueueCount | |
FROM [dbo].[Publishing_JobQueue] | |
"@ | |
$records = Invoke-SqlCommand -Connection $connection -Query $query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Function -Name Invoke-SqlCommand | |
$connection = [Sitecore.Configuration.Settings]::GetConnectionString("master") | |
$query = @" | |
SELECT COUNT(*) AS QueueCount | |
--DELETE TOP (1000) | |
FROM [dbo].[Publishing_JobQueue] | |
WHERE CAST([Options] as nvarchar(max)) LIKE '%<a:Value>sitecore\Anonymous</a:Value>%' | |
"@ | |
Invoke-SqlCommand -Connection $connection -Query $query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment