I have a situation where I have to find out those publication targets which are deleted some time back in order to unpublish those components/pages which are published and now they are not being unpublished and further not able to delete. (In this case publication targets are not known) I am using coreservice 2011/2013.
1 Answer
Well, As Peter K mentions in the comments it would be interesting to know how did you delete the Publication Targets.
But to fix your issue you can try:
- Get the Tcm Ids of the deleted Publication Targets (If somehow you can find those or you have it already)
- And then use Core Service to un-publish the items.
You can you below example function for it:
public void UnPublishComponent(string[] componentId, string[] targets, bool includeChildren)
{
UnPublishInstructionData pub = new UnPublishInstructionData();
pub.ResolveInstruction = new ResolveInstructionData() { IncludeChildPublications = includeChildren, IncludeComponentLinks = false };
PublishTransactionData[] pubTranData = tridionClient.UnPublish(componentId, pub, targets, PublishPriority.High, null);
}
-
Thanks Saurabh. This I have already tried, but need to code, if I don't know the publication Targets. Commented Nov 18, 2016 at 12:31
-
Thanks for the reply Peter, Actually I have got this situation, don't know how the other team in my company which were earlier doing this task has deleted the publication targets. Commented Nov 18, 2016 at 12:33
-
1Possibly DB hacking or they may have used some of the (many) "flaws" in the old COM API.– Nuno Linhares ♦Commented Nov 18, 2016 at 15:23