Document Id is something which SharePoint internally assigns to documents and maintains a uniqueness for each document.
This Document Id never changes even if the document is moved anywhere else and so can be used as a bookmark to the document.
Just in case you want to access the DocId value or want to change it (not recommended though !!), you can refer to the the internal SharePoint column _dlc_DocId.
Get Doc Id value for a document
$item["_dlc_DocId"]
Set Doc Id value for a document$item["_dlc_DocId"] = "NewId-12345"
Here is a complete example using PowerShell to access and modify the Document IdPowerShell script to get and set the Document Id (_dlc_DocId) column
$web = Get-SPWeb http://SharepointSiteUrl
$list = $web.lists["Shared Documents"]
//Get handle of item by ItemId
$item = $list.getitembyid(1)
//Get the Document Id using column _dlc_DocId
$item["_dlc_DocId"]
//Checkout before making changes
$item.File.CheckOut()
//Set the Document Id using column _dlc_DocId
$item["_dlc_DocId"] = "NewId-12345"
$item["_dlc_DocIdUrl"] = "http://SharePointSiteUrl/_layouts/DocIdRedir.aspx?ID=NewId-12345, NewId-12345"
$item.update()
//Check in once changes are completed
$item.File.CheckIn("DocId changed and document checked in")
Note- Once the Document Id is modified, a search crawl (incremental is sufficient) is required in order to associate the changes with the document, else you will get errors when clicking on the Document Id.
Comments:
- I tried this in my SharePoint Online tenant site, but not working. Can you share updated code for Online Management Shell ? Im using Document ID and came across a case where need to change it.
anon 13 Mar 2020 20:00:04 GMT
- not working in SharePoint Online
anon 27 Jan 2019 05:12:10 GMT
- Further comments disabled!
More Posts related to SharePoint,
- SharePoint error - An exception occurred when trying to issue security token: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms..
- PowerShell iterate and get all SharePoint sites and sub sites
- SharePoint Online: Editing session has ended Message
- How to Share Microsoft SharePoint Site with Users or Groups
- How to delete SharePoint Online List Item using REST API
- SharePoint List excel import - This table exceeds the maximum number of supported rows
- How to disable SharePoint subsite creation option for owners
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed
- SharePoint Server 2016 Preview installation error - This Product Key isn't a valid Microsoft Office 2016 Product Key. Check that you've entered it correctly.
- How to upload file programmatically to SharePoint Document Library using Server Object Model C# .Net
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Error when deleting SharePoint Online folder or file
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- How to generate client id and secret to register SharePoint App with OAuth
- How to delete SharePoint List Item programmatically using C#.Net
- How to retrieve all SharePoint Online List Items using Rest API
- [Solved] SharePoint Search Internal server error exception
- Create SharePoint Site Collection using PowerShell New-SPSite
- Fix SharePoint PowerShell error - The term Get-SPweb is not recognized as the name of a cmdlet function script file or operable program
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- SharePoint Server 2016 installation System Hardware requirements
- How to create SharePoint Online List Item using REST API
- Changed AD user display name showing old name in SharePoint
- Recommended size and resolution for SharePoint Online Site logo
- Microsoft 365: How to Turn Off Delve in SharePoint Online for All Users
More Posts:
- Changing Android Intent Tittle using java code - Android
- Angular CLI ng Error: You need to specify a command before moving on. Use --help to view the available commands - HowTos
- Ubuntu Linux: Unzip a zip file using Terminal - Ubuntu
- Android Studio : Build Tools 23.0.0 rc1 is deprecated - Android-Studio
- Fahrenheit to Celsius Temperature Convertor: Tool & Formula - Tools
- 33: Python Program to send an email vid GMail - Python
- How to recover SharePoint FARM if the SQL Server IP changes - SharePoint
- [Fix] Ubuntu E: Unable to locate package sudo error - Ubuntu