PowerShell : Get SharePoint Column GUID

  1. if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )   
  2. {   
  3.    Add-PsSnapin Microsoft.SharePoint.PowerShell   
  4. }  
  5. $web = Get-SPWeb http://yourSharePointWebURL  
  6. $columnName = Read-Host "Enter the column title (display name)"  
  7. write-host $web.Fields[$columnName].Title -nonewline  
  8. write-host " "$web.Fields[$columnName].Id -foregroundcolor Red  
  9. $web.Dispose()