wiliammbr's blog

Some thoughts on SharePoint and other random stuff

Tag: Powershell

Recover corrupt Lookup Field

Sometimes we need to transfer a list from a Production environment to a Development environment, just to reproduce some bug or situation with real data. It can achieve by the Save as Template feature, exporting it from an environment to another and then recreating the list.

But, if you have Lookup fields it can give you some headaches. As soon as the list is restored in the other environment, the Internal Guids are changed an any connection to the source list of the lookup column will be lost:

The option Get information from will be empty and the column name will be a span, not a a dropdown. where you could select which field should be presented:

Continue reading

Troubleshooting errors in SharePoint using Powershell and Get-SPLogEvent

Today I would like to share with you an useful way to troubleshoot errors in your SharePoint site when some unexpected error occurs.
You will need two things: the Correlation Id and access to Powershell or SharePoint Management Shell on the server. Once you got these two things, just paste the code below replacing the CorrelationId parameter with your Id.

This example is extremely simple, but saved my life a thousand times. The Get-SPLogEvent accepts other parameters too like Start and End Time too, that will help you on filtering better. Here is how the Log will be formatted in the text file.


© 2018 wiliammbr's blog

Theme by Anders NorenUp ↑