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!
- Move Copy Migrate SharePoint OneDrive files folders to different site collection location
- How to generate client id and secret to register SharePoint App with OAuth
- How to share SharePoint site or document with all users in organization
- Get-ADUser PowerShell - Get AD user details using email address
- error CAML Query containing special characters
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Fix SharePoint Error - The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started
- SharePoint - The URL is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
- How to delete SharePoint List Item programmatically using C#.Net
- How to Share Microsoft SharePoint Site with Users or Groups
- JSON column formatting to preview SharePoint Online file on mouse hover
- SharePoint List redirect user after submitting form NewForm.aspx
- See actual SharePoint error exception modify web.config
- SharePoint Server 2016 IT Preview Deprecated Removed features
- How to create SharePoint Document Library
- How to Get or Set SharePoint Document ID _dlc_DocId using PowerShell
- How to disable SharePoint subsite creation option for owners
- PowerShell - How to use Try Catch Finally blocks for error exception handling (Windows/SharePoint)
- SharePoint error - Your organization doesn't allow sharing with users from this domain. Please contact your IT department for help. (OSE403)
- [Solved] SharePoint Search Internal server error exception
- How to wrap column text in SharePoint Online Modern List Grid View using JSON formatting
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- Changed AD user display name showing old name in SharePoint
- How to hide or remove quick launch left navigation from SharePoint Online Modern site page
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- Find and Replace Multiple different words with the same word in a text file - NotepadPlusPlus
- Git Commit - Author identity unknown, Please tell me who you are email - Git
- JavaScript : Get url protocol HTTP, HTTPS, FILE or FTP - JavaScript
- How to resolve Failed to create interpreter PyCharm Error - Python
- Java + Spring JDBC Template + Gradle Example - Java
- How to Open PowerShell on Mac? - Powershell
- Shortcut: Cut (or Delete) current line in Visual Studio Code (VSCode) - HowTos
- [Mac] To open Eclipse you need to install the legacy java se 6 runtime - Mac-OS-X