After a Tridion CMS Database restore from another environment we cannot unpublish Components from the Broker. If we publish to the Broker then we can unpublish. We want to set the IsPublishedTo status to the publish targets available in the new envioronment.
The TOM API has a SetPublishedTo method available for Pages and Component Templates but not Components.
How can I set the PublishedStatus for the Components? Is it possible using UpdateXML or do we need to perform database black magic?
I use the following C# based code in a command line tool for switching the PublishStates of all my items after a SDL Tridion 2009 environment switch (What version are you using?):
So basically setting the CT to UnPublished should do what you need, as the Component is not technically published, it is a Component Presentation based on that CT.