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!
- Change SharePoint Online List Experience to New Experience from Classic
- Cannot load PowerApps form in SharePoint Online due to repeated authentication
- Create SharePoint list from Excel spreadsheet and import table
- [Solved] SharePoint Search Internal server error exception
- [Fix] SharePoint: This embed code doesnt seem to work. We only support iframe based embeds
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- SharePoint Online: Editing session has ended Message
- SharePoint error cannot connect to the configuration database
- That did'nt work, Issue type User not in directory - SharePoint external access error
- How to embed web page in SharePoint
- 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.
- SharePoint error 2130575251 - The security validation for this page is invalid and might be corrupted
- Microsoft 365: How to Turn Off Delve in SharePoint Online for All Users
- SharePoint Server 2016 error Microsoft Office Online Server 2016 cant be installed on the same machine as a Microsoft SharePoint Server product
- JSON column formatting to preview SharePoint Online file on mouse hover
- How to show Videos on SharePoint Page
- How to get SharePoint Online user details from person or group column using REST API
- How to retrieve all SharePoint Online List Items using Rest API
- How to wrap column text in SharePoint Online Modern List Grid View using JSON formatting
- Recommended size and resolution for SharePoint Online Site logo
- SharePoint List redirect user after submitting form NewForm.aspx
- Add Custom External Link to SharePoint Site Navigation
- Drag drop files here option missing for SharePoint document library
- Can Microsoft SharePoint Lists be synced and accessed offline without internet?
- SharePoint - Use Today's Date Time in list view filter and calculated column
- How to Screenshot on Mac Ventura 13 - Step by Step Guide - MacOS
- Path of homebrew (brew) installation in macOS Big Sur - MacOS
- How to update Cargo (Rust Lang) - Rust
- What is exit(0), exit(1) ... exit(8) codes in Python Programming - Python
- Android Lint app_name is not translated in af (Afrikaans) am (Amharic) ar (Arabic) bg (Bulgarian) - Android
- Comprehensive Tutorial: Ways to Create Objects in JavaScript - JavaScript
- Fix: ZSH: cd: too many arguments (macOS) - zsh
- Add HTML to Android Activity or TextView - Android