kwizcom banner advertisement

Delete a Site Column using PowerShell in SharePoint

How to Delete a Site Column in SharePoint?
To remove a site column in SharePoint, Navigate to:
  • Site Actions >> Site Settings
  • Click on "Site Columns" >> Pick your target site column
  • Scroll down and click on "Delete" button
sharepoint 2013 powershell delete site column
Delete a Site Column using PowerShell in SharePoint
To delete site column using PowerShell in SharePoint, use this script:
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$RootWebURL ="http://intranet.crescent.com"

#Internal Name of the site column to delete
$SiteColumnToRemove="Departments"

#Get the Root Web
$RootWeb = Get-SPWeb $RootWebURL

#Check if a site column exists already
    if ($RootWeb.Fields.ContainsField($SiteColumnToRemove))
    {
        #delete site column powershell sharepoint
        $Rootweb.Fields.Delete($SiteColumnToRemove)

        Write-host "Site column has been Deleted Successfully!" 
    }
This removes the site column from SharePoint site!

Tags: sharepoint delete site column with powershell, remove site column using powershell, sharepoint remove site column powershell
Delete a Site Column using PowerShell in SharePoint Delete a Site Column using PowerShell in SharePoint Reviewed by Salaudeen Rajack on 7:08 PM Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.