Posts

Restore a Deleted Site Collection

1.         1.    Run Get-SPdeletedsite from PowerShell. You will see your site collection here with Site ID 2.        2 .  Then run Restore-SPDeletedSite –Identity “XXXXXXXX-XXXX-XXXXX-XXXX-XXXXXXXXXXXX”

SharePoint Powershell Import/Export and Move SPWeb

Export-SPWeb “http://sp2010/subsite” -Path "C:\subsite.cmp" -IncludeUserSecurity Import-SPWeb “http://sp2010/subsite” -Path "C:\subsite.cmp" -IncludeUserSecurity -UpdateVersions Overwrite -Force Get-SPSite "http://sp2010" | Propagate-SPContentType -Identity "Document" –UpdateFields Move-SPWeb -Identity "http://sp2010/subsite" -Parent http://sp2010 -UrlName "BlankSubsite"

Change the List View Threshold, List View Lookup Threshold and Other Resource Throttling Settings

1- Login to Central Admin 2- Go to Application Management -> Manage Web Applications 3- Pick the Web application for which you want to change the LVT (If you only have 1 web app plus the central admin one, the one you want to pick is the 1 web app; changing this for the central admin does you no good) 4- In the ribbon above, click General Settings. That will bring down a menu, from which you should pick Resource Throttling

SharePoint 2010 currently installed version

There are different methods to find currently installed version of SharePoint. Method 1:   SharePoint 2010 Central Administration: 1.      Open  SharePoint 2010 Central Administration 2.      Click System Settings 3.      Click Manage Servers in This Farm 4.      See  Configuration Database Version  field Method 2:  Detailed from SharePoint 2010 Central Administration: 1.      Open  SharePoint 2010 Central Administration 2.      Click Upgrade and Migration 3.      Click Check Product and Patch Installation Status 4.      See  Version  column Method 3:  SharePoint PowerShell: 1.      Open  SharePoint 2010 Management Shell(run as administrator)  2.      Type   (get-spfarm).buildversion

SharePoint 2010 : Mount and Test database using Power Shell

mount-SPContentDatabase "WSS_NRM_3333" -DatabaseServer "kpk01" -WebApplication http://kpk01:3333 Test-SPContentDatabase -name WSS_NRM_3333 -webapplication http://kpk01:3333

SharePoint Power Shell : Remove/Delete users from User Information List

Script: $url = "http://sitecollection" $web = get-spweb $url $list = $web.Lists["User Information List"] $listItems = $list.Items $listItemsTotal = $listItems.Count for ($x=$listItemsTotal-1;$x -ge 0; $x–-) { Write-Host(“DELETED: ” + $listItems[$x].name) remove-spuser $listItems[$x]["Account"] -web $url -confirm:$false } $web.dispose() Url: http://[localhost]/_catalogs/users/simple.aspx)

How to change SharePoint My Site Host Url using Power Shell

$AnySiteCollectionUrl = "http://SPSite/" $site = Get-SPSite $AnySiteCollectionUrl $context = Get-SPServiceContext($site) $pm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($context) Write-Host "previous My Site Host Url: " $pm.MySiteHostUrl -ForegroundColor Yellow; $pm.MySiteHostUrl = "" $pm.MySiteHostUrl = "http://mysiteurl/" Write-Host "new My Site Host Url: " $pm.MySiteHostUrl -ForegroundColor Yellow; $site.Dispose()