Hello Guys,
I am struggling to resolving on below approach, Can you please help me out ?
Kindly consider below scenario :
WebApplication : Sharepoint -1111
Site Collections :
1. http://mysite:1111/
2. http://mysite:1111/sites/dc1
3. http://mysite:1111/sites/dc2
4. http://mysite:1111/sites/dc3
All site collections having DOC ID feature enabled and working, Is there anyway to find out document of any site collection by document ID in top level site collection ?
Your help will be highly appreciated.
Thanks and Regards,
Please check this out: I have created a console Application to get documents based on ID from all site collection of one Web Application
Add reference to Microsoft.Office.DocumentManagement assembly from 15hive\ISAPI folder
static void Main(string[] args)
{
string[] arrDocumentIDs = { “ASGAKS-4-1”, “DOCUMENT-4-1” };
SPWebApplication webApp = SPWebApplication.Lookup(new Uri(“http://site”));
SPSiteCollection sites = webApp.Sites;
foreach (SPSite site in sites)
{
Console.WriteLine(“{0}:- {1}”, site.RootWeb.Title, site.Url);
DocumentIdProvider provider = DocumentId.GetProvider(site);
foreach (string strDocId in arrDocumentIDs)
{
try
{
var result = provider.GetDocumentUrlsById(site, strDocId);
Console.WriteLine(result[0]);
}
catch { }
}
}
Console.ReadLine();
}Hope this will help you out