As we aware the WebpartManager class is helpful in Server side object model. The question popped-up in my mind “Is this possible by using PowerShell scripting?“.
I found answer as “Yes”.
Below is the code snippet to remove webpart from a site by specifying webpartId and site url,
$siteURL = “ht tp://sharePoint/sites/specialsite”; # first constant: site URL
$webpartId = “<guid of your choice for webpart>; # second argument: webpart GUID
$pagepath = “/default.aspx” # change page name or page path here
$pageURL = $siteURL + $pagepath
write-host “Processing site: “, $siteURL
Write-host “Processing page: ” , $pageURL
write-host “Processing webpart ID: ” , $webpartID