Thursday, 18 October 2018

Managed Metadata terms changes display name is reflecting . Taxonomy Update Scheduler is not working

I am using Terms in list publish using Managed metadata services. I required to do Change certain terms . its Changed successfully.

I open the list where i am using it , its update as display only, when i use custom code to fetch the term its still showing the previous name. 

i verify the Taxonomy Update Scheduler from timer services , its running without any error, but somehow its not updating the values.

There is hidden list for taxonomy  that is need being update automatically, 

Need to update the Hidden list using powershell with below script.

$siteUrl = "http://devvmspap01:15734/"
$site = Get-SPSite $siteUrl
[Microsoft.SharePoint.Taxonomy.TaxonomySession]::SyncHiddenList($site)
$site.dispose()


Wednesday, 17 October 2018

Migrate SharePoint SiteCollections from one farm to another farm using Content Database

SharePoint Site collection can be moved to another farm or location using site collection backups or Content database back up.

If you required only one sitecollection then we can backup site collection using powershell or SharePoint central admin.

in my cases i have 2 site collection in one web application and both are using same content database.

I use Content database method.

Step 1 : backup Content Database from SQL Server.


Step 2: Restore Content database to new SQL Server (new Loction)
 








Step 3: Mount-SPContentDataBase
           
if you don't have existing web application please create new web application  and mount your database to web application, it will use the same managed path as you have in original location.

Mount-SPContentDatabase "WSS_Content_MyDB" -DatabaseServer "DEVVMSPDB01\SP2013DB" -WebApplication http://devvmspap01:15734/

SharePoint Database Log file is increase. (Shrink the SharePoint database Log file)


SharePoint Log files are Increase more then database file or some time increased more then it, 
Easy way is to reduce the log size using  Shrink the Log file.


-- Set database to simple
ALTER DATABASE WSS_Conten_MyDB
SET RECOVERY SIMPLE; 
GO 


-- 1st parameter is Database Log File name , 2nd parameter is new log Size in MB (100 MB)
DBCC SHRINKFILE (WSS_Conten_MyDB_Log, 100); 
GO 


-- Reset the database recovery model to full
ALTER DATABASE WSS_Conten_MyDB
SET RECOVERY FULL; 
GO 


Friday, 4 May 2018

SharePoint 2013 Audit Log Report , Error , Report Contains no data.


SharePoint 2013 Audit log report contains no

Sorry, something went wrong

Report contains no data.



Reason :

Resolution :

Go to Site Settings and Set the Site collection audit settings.

 


Click on Site Collection Audit Settings. and Set the settings


Try to Regenerate the Report. and it will work.

Friday, 27 April 2018

Get All items in SharePoint List Using PowerShell


Get All items from List or Library Using Power Shell.

# Add below Reference if your using Power shell ISE  
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

# Web Url
 $WebUrl="https://My web/"
 $Web = Get-SPWeb -Identity $WebUrl

# List Name
 $ListName ="PROJECT MANAGEMENT"

# Try to get List
 $List = $web.Lists.TryGetList($ListName)

#Get Count of Items
 Write-Host "  No of item: " $list.Items.Count 
 foreach($Item in $list.Items)
 {
   # Here you can iterate Item , Such as i required URL for Each item
    Write-Host $Item.Url
 }

or 

 $WebUrl="https://cdms.pr1ma.my/dev1/jhr/P-JHR-2014-00073"
 $Web = Get-SPWeb -Identity $WebUrl
# Get List Name
 $ListItems = $Web.lists["PROJECT MANAGEMENT"]
#Get Formated Resutls

 $ListItems.items | format-table -property title,url

Wednesday, 25 April 2018

Get All Site Collections & all Site in Web application using Powershell

How to Get all site Collections in SharePoint Web Application


Add-PSSnapIn "Microsoft.SharePoint.Powershell"
$SiteCollection= get-spsite -limit all -WebApplication https://Server

foreach($Site in $SiteCollection)
{
    foreach($web in $Site.AllWebs)
       {
        Write-Host $web.url
      }
     
}

More details: https://docs.microsoft.com/en-us/sharepoint/sites/view-all-site-collections

Monday, 26 March 2018

Site Collection Restore failed : InvalidData: (Microsoft.Share...dletRestoreSite: SPCmdletRestoreSite) [Restore-SPSite], DirectoryNotFoundException

Site-collection restore failed with below error

Restore-SPSite : 0x80070003 At line:1 char:1 + Restore-SPSite SiteURlTarget -Path C:\Backup\2018.bak -For ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ + CategoryInfo : InvalidData: (Microsoft.Share...dletRestoreSite: SPCmdletRestoreSite) [Restore-SPSite], DirectoryNotFoundException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite 


Cause: Database is not upgrade after installation of updates. 
Steps to resolves: 
1.       Upgrade the Database with below command. Upgrade-SPContentDatabase WSS_Content_DB


2.       Take the backup of collection   Backup-SPSite http://server:9999/source  -Path C:\Backup\myBackup2018.bak  

3.       Restore the backup.   Restore-SPSite http://server:9999/Target -Path C:\Backup\myBackup2018.bak