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"
|ADsADsAds| 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,
- [Solved] SharePoint Access Denied error editing Document Name
- See actual SharePoint error exception modify web.config
- SharePoint 2010 DataForm Unable to display this Web Part System.StackOverflowException
- SharePoint List redirect user after submitting form NewForm.aspx
- How to retrieve all SharePoint Online List Items using Rest API
- SharePoint workflow Canceled - Coercion Failed: Unable to transform the input lookup data into the requested type
- SharePoint error cannot connect to the configuration database
- Not receiving email notification alert in SharePoint Online workflow - Power Automate, FLOW
- How to create SharePoint List Item programmatically
- SharePoint CAML query error - The XML source is not correct
- Sharepoint Server 2016 installation Prerequisites with download links
- Sharepoint errors were found when compiling the workflow
- Send Email with attachment using SharePoint PowerShell, SMTP server
- Sign in as different user missing in SharePoint 2013
- SharePoint List excel import - This table exceeds the maximum number of supported rows
- SharePoint Managed Metadata Hidden Taxonomy List - TaxonomyHiddenList
- Changed AD user display name showing old name in SharePoint
- How to migrate SharePoint Designer 2010 workflow to Power Automate FLOW (Microsoft Office 365)
- SharePoint Server 2016 error Microsoft Office Online Server 2016 cant be installed on the same machine as a Microsoft SharePoint Server product
- Fix SharePoint 2019 installation error This product requires Visual C++ Redistributable Package for Visual Studio 2017
- Deploy SharePoint wsp solution package using PowerShell
- How to delete SharePoint List Item programmatically
- New-SPLogFile PowerShell - create new SharePoint log file
- SharePoint An unexpected error has occurred - Correlation ID and Merge-SPlogfile
- Change SharePoint search results FullTextSqlQuery RowLimit 10000
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed
- Bypass domain name for IIS site (SharePoint)
- SharePoint error - Your organization doesn't allow sharing with users from this domain. Please contact your IT department for help.
- 'Edit Document' Requires a Windows Sharepoint Services-compatible application and Microsoft Internet Explorer 6.0 or higher
- SharePoint list excel import error - Title is a required filed and can't be empty
- SharePoint error - An exception occurred when trying to issue security token: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms..
- Cannot load PowerApps form in SharePoint Online due to repeated authentication
- How to hide quick launch in SharePoint
- How to exclude results from SharePoint Search
- SharePoint Designer Workflow error - Coercion Failed: Input cannot be null for this coercion
- Get-ADUser PowerShell - Get AD user details using email address
- PowerShell iterate and get all SharePoint sites and sub sites
- SharePoint Server 2016 IT Preview Deprecated Removed features
- SharePoint excel error - A problem occurred while connecting to the server. If the problem continues, contact your administrator.
- Merge-SPlogfile PowerShell - SharePoint Correlation ID error
- SharePoint Server 2016 IT Preview - new improved Features and Enhancements
- Recover SharePoint if the SQL Server IP changes
- SharePoint PowerShell Merge-SPLogFile filter by time using StartTime EndTime
- SharePoint formula - Calculated columns cannot contain volatile functions like Today and Me
- [Solved] SharePoint System.IO.FileNotFoundException was unhandled
More Posts:
- The declared package does not match the expected package Eclipse - Android
- JSON Tutorial: List of Lessons - Json-Tutorial
- Android : No Launcher activity found! Error - Android
- Set Title to Android AlertDialog - Android
- Android AlertDialog with Yes No and Cancel Button - Android
- New-SPLogFile PowerShell - create new SharePoint log file - SharePoint
- Get HTML table td, tr or th inner content value with id or name attribute - Html
- Center Align TextView Android Horizontally or Vertically - Android
- NOTE: This project contains resource errors, so aapt did not succeed, which can cause rendering failures. Fix resource problems first. - Android
- Android Disable back button programatically - Android
- How to make a dummy phone call from Android Emulator device - Android
- How to extract deployed WSP solution from SharePoint FARM using PowerShell - SharePoint
- Kill or force quit stuck application or process in Mac OS X - Mac-OS-X
- Deploy SharePoint wsp solution package using PowerShell - SharePoint
- Calculate Volume of Sphere - C-Program