About Me

Having 12 years experience in Microsoft technologies.Since more than 7 years working in SharePoint technologies. Expert in providing consultation for SharePoint projects. Hands on with development and administration.

Wednesday 22 February 2012

Powershell script to get items & orphaned items in SharePoint 2010 solution gallery

Generally when you retreive items from solution gallery through object model, we don't get items which has been deleted without deactivating them. In order to get those, we should write powershell object model.

Here is the code. pass $url

$site= new-Object Microsoft.SharePoint.SPSite($url)
$web = $site.Openweb()                       

$list = $web.lists["Solution Gallery"]
$items = $list.items                     
            foreach($item in $items)
            {  
                $itemtitle = $item.Name                      
                write-host $itemtitle

            } 

Happy programming.....    
           

No comments:

Post a Comment