Skip to main content

Posts

Showing posts from June, 2020

Change "Created By' field in SharePoint Library

I got an requirement to change the created by to different user after a user left the firm.  I tried an approach with Powershell but I found it easy to update in content database.  Change the "Created by" field through the SQL content database(Tables dbo.alldocs and dbo.alluserdata). In dbo.alluserdata change tp_author to the new sharepoint ID, and any of the nvarchar names referencing the old account name. In dbo.alluserdata and dbo.alldocs change just tp_draftownerid.  Through PowerShell and credit goes  here   # Get the SharePoint Assembly # You will need to run this on the SharePoint Server [Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") # The site my list was in was at  http://dev # create a new object called $SPSite $SPSite = New-Object Microsoft.SharePoint.SPSite(" http://dev/") # Make sure you have the last “/” in the url on the site # allow $SPWeb to be the OpenWeb from the si

Sign in as different User - SharePoint 2013 and higher

Usually when you have 2 user accounts (regular and admin) in your organization and infrastructure will give only access to your admin account and when you try to open a sharepoint 2013 site it says access denied by default coz you logged in with your regular account by default and SharePoint 2013 dont give option to "sign in as different user" by default. You can use _layouts/closeConnection.aspx?loginasanotheruser=true this extension to get the sign-in pop up window. Hope this helps

Run workflow on existing items - SharePoint 2013 or higher

I had to create a workflow on a existing list which has already around 250 items. I need to run the workflow on existing items which don't change.  1. I can use retention , but I dont have CA access to either enable or check the timer jobs related to it.  2. Custom timer job or solution (As this is one time thing I didnt wanted to exhaust my energy) Solution (Which i thought is useful for me)  Change the workflow initiation to "Run when the item is changed" create a column with number type open the lint in "quickview"  add "some number" in all the items in the new column Click "Stop" on the top of the list.  It will run the workflow on all items one time as you made the change on every item by adding a field value.  Hope this helps someone in need without any extra effort.