Wednesday, January 21, 2015

Delete a Site Column using PowerShell 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: delete site column using powershell, sharepoint delete site column with powershell, remove site column using powershell, sharepoint remove site column powershell



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...