Wednesday, August 15, 2012

SharePoint Search problem after migration

After migrating from WSS 3.0 to Foundation 2010 cannot search inside a document.
Basically it shows in the document property "Pending", so the document waiting for approval.
Created a small PowerShell script to approve all documents on a site:

$mySite=Get-SPSite "http://yoursite"
foreach ($myWeb in $myWebSub)
    $myWeb=Get-SPWeb $myWeb.url
    $myLIb=$myWeb.lists|where {($_.BaseTemplate -eq "DocumentLibrary")}
    foreach ($lib in $myLib)
        foreach ($doc in $MyDocs)
            $                             # only for information
            $doc.file.level                       # only for information
            if (($doc.file.level -eq "Draft") -or ($doc.file.level -eq "Pending")){$doc.file.Approve("script")}
            $doc.file.level                        # only for information

No comments:

Post a Comment