Well, in the previous post,
We learned how to install, configure and enable Boldon James Classifier for SharePoint.
In that Post, we had a section, which was about how to activate the Boldon James SharePoint Classifier feature for the site collection and apply endpoint. If we have a few sites, we can do it manually. However, think about a big farm, which has multiple Web Applications and each Web Application has thousands of site collections, the task becomes very tedious and challenging.
Therefore, we need some sort of script or code, which can do this for us without having us put in more effort. For that, the first thing came to my mind is PowerShell script. Well, I went ahead and prepared the script, which makes our task much easier. All we need to do is, just place the script in SharePoint Server and provide a few inputs at run time. That’s it, the script will take over from there and do our task.
Script
Save the script given below to SharePoint Server.
- <#
- .SYNOPSIS
- Sets the SharePoint Classifier Service EndPoint URL for a Site Collection
- .DESCRIPTION
- Sets the SharePoint Classifier Service EndPoint URL for a Site Collection
- #>
-
- Function PromptForServiceEndPointURL
- {
- $ServiceEndPointAccpeted = $false
- While($ServiceEndPointAccpeted -ne $true)
- {
- $EndPointInput = Read-Host -Prompt "Please provide Boldon James Classifier Service Endpoint URL"
- if($EndPointInput -ne $null -and $EndPointInput -ne "")
- {
- try
- {
- $xHTTP = new-object -com msxml2.xmlhttp;
- $xHTTP.open("GET",$EndPointInput,$false);
- $xHTTP.send();
- $xHTTP.status # returns the status code
- if ($xHTTP.status -eq "200")
- {
- Write-Host -ForegroundColor Green "Endpoint URL has been accepted..."
- $ServiceEndPointAccpeted = $true
- }
- else
- {
- Write-Host -ForegroundColor Red "Endpoint URL is not valid, please provide valid input..."
- }
- }
- catch
- {
- Write-Host -ForegroundColor Red "Endpoint URL validation failed..."
- }
- }
- else
- {
- Write-Host -ForegroundColor Red "Invalid URL, please enter correct URL..."
- }
- }
- Return $EndPointInput
- }
- Function ApplyBoldonJamesServiceEndPoint($SiteCollectionUrl, $SCServiceEndpointUrl)
- {
- try
- {
- $FeatureActivated = $false
- $ActivationResults = @()
- $ValueAccepted = $false
- $site = New-Object Microsoft.SharePoint.SPSite($SiteCollectionUrl)
- if((Get-SPFeature "SharePointClassifier_Classifier" -Site $Site -ErrorAction SilentlyContinue) -eq $null)
- {
- Write-Host "Feature is not enabled, enabling it now..."
- $Feature = Enable-SPFeature "SharePointClassifier_Classifier" -Url $Site.URL -ErrorAction SilentlyContinue
- Write-Host "Enabled Feature"
- if((Get-SPFeature "SharePointClassifier_Classifier" -Site $Site -ErrorAction SilentlyContinue) -eq $null)
- {
- $FeatureActivated = $False
- $ActivationResults += $false
- }
- }
- else
- {
- $FeatureActivated = $true
- $ActivationResults += $true
- }
- if($FeatureActivated -eq $true)
- {
- Write-Host Now adding the property
- $rootWeb = $site.RootWeb
-
- Write-Host -foregroundcolor Green "The Site Collection Root Site is" $rootWeb
-
- $EndPointProperty = "bjEndpointAddress"
-
- $rootWeb.AllowUnsafeUpdates = $true;
- $Currentvalue = $rootWeb.AllProperties[$EndPointProperty]
- Write-Host -foregroundcolor Green "The current value is "$Currentvalue
-
- if (!$rootWeb.AllProperties.ContainsKey($EndPointProperty))
- {
- $rootWeb.AllProperties.Add($EndPointProperty, $SCServiceEndpointurl);
- }
- else
- {
- $rootWeb.AllProperties[$EndPointProperty] = $SCServiceEndpointurl;
- }
-
- $rootWeb.Update();
-
- $rootWeb.AllowUnsafeUpdates = $false;
-
- $UpdatedValue = $rootWeb.AllProperties[$EndPointProperty]
- Write-Host -foregroundcolor Green "Value is updated with " $UpdatedValue
-
- if($UpdatedValue -eq $SCServiceEndpointUrl)
- {
- $ValueAccepted = $true
- }
- else
- {
- $ValueAccepted = $false
- }
- if ($rootWeb -ne $null)
- {
- $rootWeb.Dispose()
-
- }
- If ($site -ne $null)
- {
- $site.Dispose();
- }
- $ActivationResults += $ValueAccepted
- }
- else
- {
- $ActivationResults += $false
- }
- Return $ActivationResults
- }
- catch
- {
- $ActivationResults += $FeatureActivated
- $ActivationResults += $ValueAccepted
- Return $ActivationResults
- }
-
- }
- Function ApplyEndPointUsingIE($EPURL, $SCURL)
- {
- Try
- {
- $addedToLocalIntranetZone = $false
- $SiteName = "*"
- $myDomain = "yourdomain.com"
- #Write-Host -F Yellow "Verifying existence of "$SiteName"."$myDomain" in Local Intranet Zone"
- $RegItem_Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" + $myDomain + "\" + $SiteName
- If((Test-Path $RegItem_Path -ErrorAction SilentlyContinue) -eq $True)
- {
- #Write-Host -F Cyan $SiteName"."$myDomain already exists in Local Intranet Zone
- $addedToLocalIntranetZone = $true
- #Exit 1001
- }
- Else
- {
- #Write-Host -F Blue $SiteName"."$myDomain not found in Local Intranet Zone, adding it now
- New-Item $RegItem_Path -Force | Out-Null
- New-ItemProperty -Path $RegItem_Path -Name https -Value 1 -PropertyType DWord | Out-Null
- New-ItemProperty -Path $RegItem_Path -Name http -Value 1 -PropertyType DWord | Out-Null
- If((Test-Path $RegItem_Path -ErrorAction SilentlyContinue) -eq $True)
- {
- #Write-Host -F Green $SiteName"."$mydomain has been added to Local Intranet Zone
- $addedToLocalIntranetZone = $true
- }
- else
- {
- #Write-Host -F Red $SiteName"."$mydomain could not be added to Local Intranet Zone
- }
- }
-
- }
- Catch
- {
- #Write-Host -F Red "An error occurred while verifying "$SiteName"."$myDomain" in Local Intranet Zone"
- #Exit 1001
- }
- if($addedToLocalIntranetZone -ne $false)
- {
- $SiteCollectionURL = $SCURL
- $ActivationResults = @()
- $FeatureActivated = $false
- if((Get-SPFeature "SharePointClassifier_Classifier" -Site $SiteCollectionURL -ErrorAction SilentlyContinue) -eq $null)
- {
- #Write-Host "Feature is not enabled, enabling it now..."
- $Feature = Enable-SPFeature "SharePointClassifier_Classifier" -Url $SiteCollectionURL -ErrorAction SilentlyContinue
- #Write-Host "Enabled Feature"
- if((Get-SPFeature "SharePointClassifier_Classifier" -Site $SiteCollectionURL -ErrorAction SilentlyContinue) -eq $null)
- {
- #Write-Host -F Red "Feature could not be activated on the site"
- $ActivationResults += $False
- }
- else
- {
- #Write-Host -F Green "Feature has been activated on the site"
- $ActivationResults += $true
- $FeatureActivated = $true
- }
- }
- else
- {
- #Write-Host -F Cyan "Feature is already activated on the site"
- $ActivationResults += $true
- $FeatureActivated = $true
- }
-
- if($FeatureActivated -eq $true)
- {
- $URI = $SiteCollectionURL + "/_layouts/15/SharePointClassifier/SharePointClassifierSiteSettings.aspx"
- $ieObject = new-object -com "InternetExplorer.Application"
- $ieObject.navigate($URI)
- for($i = 10; $i -gt 0; $i--)
- {
- #Write-Host -F Yellow "Authenticating, please wait for $i second(s)...`r" -NoNewLine
- Sleep -s 1
- }
- #Write-Host -F Green "Internet Explorer has been opened successfully..."
- $ieObject.visible = $true
-
- #Retrieve the HTML document returned by search page to an object
- $doc = $ieObject.Document
-
- #Write-Host -F Yellow "Please wait while the service endpoint is being applied..."
- #Enter value to be searched in the search text box
- $doc.getElementByID("ctl00_PlaceHolderMain_TextBoxServiceEndPointAddress").Value = $EPURL
-
- #Click on Search button
- $doc.GetElementByID("ctl00_PlaceHolderMain_LinkButtonServiceSettings").Click()
-
- do
- {
- sleep 1
- #Write-Host "Please wait while the operation is being processed...`r" -NoNewLine
- }
- until(-not ($ieObject.Busy))
- #Write-Host
- #Write-Host -F Green "Operation has been processed by the browser..."
-
- $EndPointResultErrorElementFound = $False
- $EndPointResultSuccessElementFound = $False
- $EndPointResultErrorText = "NA"
- $EndPointResultSuccessText = "NA"
- While($EndPointResultErrorElementFound -ne $True -or $EndPointResultErrorElementFound -ne $True)
- {
- #Write-Host -F Yellow "Loading page contents, please wait... `r" -NoNewLine
- $EndPointResultDoc = $ieObject.Document
- $EndPointResultErrorElement = $EndPointResultDoc.GetElementByID("ctl00_PlaceHolderMain_ServiceSettingsError")
- if($EndPointResultErrorElement -ne $null)
- {
- $EndPointResultErrorElementFound = $true
- $EndPointResultErrorText = $EndPointResultErrorElement.OuterText
- #Write-Host -F Red Error Element Found, Error Is: $EndPointResultErrorText
- }
- $EndPointResultSuccessElement = $EndPointResultDoc.GetElementByID("ctl00_PlaceHolderMain_ServiceSettingsSuccess")
- if($EndPointResultSuccessElement -ne $null)
- {
- $EndPointResultSuccessElementFound = $true
- $EndPointResultSuccessText = $EndPointResultSuccessElement.OuterText
- #Write-Host -F Green Success Element Found, Message: $EndPointResultSuccessText
- }
-
- Sleep -s 1
- }
- #Write-Host
- #Write-Host -F Green "Boldon James Classifier service page has been loaded..."
-
- #Check whether the search operation succeeded or not
- if($EndPointResultSuccessText -ne "" -and $EndPointResultSuccessText -ne $null)
- {
- #Write-Host -F Green "Operation successful..."
- #Write-Host -F Magenta Result: $EndPointResultSuccessText
- $ErrorOccurred = "No"
- }
- elseif($EndPointResultErrorText -ne "" -and $EndPointResultErrorText -ne $null)
- {
- #Write-Host -F Red "Operation failed..."
- #Write-Host -F Magenta Result: $EndPointResultErrorText
- $ErrorOccurred = "Yes"
- }
- $ieObject.Quit()
- if($ErrorOccurred -eq "No")
- {
- $ActivationResults += $true
- }
- elseif($ErrorOccurred -eq "Yes")
- {
- $ActivationResults += $false
- }
- }
- else
- {
- $ActivationResults += $false
- }
- Return $ActivationResults
- }
- else
- {
- #Write-Host "Terminating the execution as the domain could not be added to Local Intranet Zone..."
- $ActivationResults += $false
- $ActivationResults += $false
- Return $ActivationResults
- }
- }
- Clear-Host
- Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue
- if((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -ne $null)
- {
- Write-Host -ForegroundColor Cyan "============================================================="
- Write-Host -ForegroundColor Magenta " Boldon James Service Activation "
- Write-Host -ForegroundColor Cyan "============================================================="
- Function PromptForScopeSelections
- {
- $promptTitle = "Scope selection"
- $promptMessage = "Please select the option to set scope for applying Boldon James Classifier EndPoint"
-
- $optionSite = New-Object System.Management.Automation.Host.ChoiceDescription "&Site Collection", `
- "Apply for one site collection"
- $optionSite.HelpMessage = "This option will apply Boldon James Classifier Service EndPoint for one site collection"
-
- $optionWebApp = New-Object System.Management.Automation.Host.ChoiceDescription "&Web Application", `
- "Apply for all site collections in a web application"
- $optionWebApp.HelpMessage = "This option will apply Boldon James Classifier Service EndPoint for all site collections in one web application"
-
- $optionFarm = New-Object System.Management.Automation.Host.ChoiceDescription "&Farm", `
- "Apply for all site collections in all web applications"
- $optionFarm.HelpMessage = "This option will apply Boldon James Classifier Service EndPoint for all site collections in all web applications"
-
- $promptOptions = [System.Management.Automation.Host.ChoiceDescription[]]($optionSite, $optionWebApp, $optionFarm)
-
- $promptResult = $host.ui.PromptForChoice($promptTitle, $promptMessage, $promptOptions, 0)
- Return $promptResult
- }
-
- Write-Host -ForegroundColor Green "SharePoint snap-in has been loaded successfully..."
-
- #Call the function to prompt for scope selection.
- $UserOption = 3
- $UserOptionAccepted = $false
- While($UserOptionAccepted -ne $true)
- {
- $UserOption = PromptForScopeSelections
- if($UserOption -ge 0 -and $UserOption -le 3)
- {
- Write-Host -ForegroundColor Green "Input has been accepted."
- switch ($UserOption)
- {
- 2 {Write-Host -ForegroundColor DarkCyan "You selected farm."}
- 1 {Write-Host -ForegroundColor DarkCyan "You selected web application."}
- 0 {Write-Host -ForegroundColor DarkCyan "You selected site collection."}
- }
- $UserOptionAccepted = $true
- }
- elseif($UserOption -lt 0 -or $UserOption -ge 3 -or $UserOption -eq "" -or $UserOption -eq $null)
- {
- Write-Host -ForegroundColor Red "Invalid input..."
- }
- }
- if($UserOptionAccepted -eq $true)
- {
- $ScriptPath = Split-Path $MyInvocation.MyCommand.Path
- $ScriptDate = Get-Date -Format "dd-MMM-yyyy"
- $ScriptTime = Get-Date -Format "hh-mm-ss"
- $SiteCounter = 0
- $SuccessCount = 0
- $FailedCount = 0
- $WebAppCounter = 0
- [string]$EndPointURLDummy = PromptForServiceEndpointURL
- $EndPointURLTemp = $EndPointURLDummy + "/soap/"
- $EndPointURL = $EndPointURLTemp.ToString().Replace("200 ","")
- if($EndPointURL -eq $null -or $EndPointURL -eq "")
- {
- Write-Host -ForegroundColor Red "EndPoint URL is not valid, terminating the execution..."
- Return
- }
- if($UserOption -eq 2)
- {
- $BJReportPath = $ScriptPath + "\" + "SharePointFarm_BoldonJamesActivation_" + $ScriptDate + "_" + $ScriptTime + ".csv"
- "Site URL`tBJ EndPoint Applied?" | Out-File $BJReportPath
- $WebApplications = Get-SPWebAppllication -ErrorAction SilentlyContinue
- if($WebApplications.Count -ge 1)
- {
- $WebAppsCount = $WebApplications.Count
- ForEach($WebApplication in $WebApplications)
- {
- $WebAppCounter++
- $SiteCollections = Get-SPSite -Limit All -WebApplication $WebApplication -ErrorAction SilentlyContinue
- $SiteCollectionsCount = ($SiteCollections | Measure).Count
- if($SiteCollectionsCount -ge 1)
- {
- ForEach($RootSite in $SiteCollections)
- {
- $SiteCounter++
- Write-Host -ForegroundColor DarkMagenta "Processing site no. " -NoNewline
- Write-Host -ForegroundColor Cyan "$siteCounter out of $SiteCollectionsCount " -NoNewline
- Write-Host -ForegroundColor Magenta " in Web App $WebAppCounter out of $WebAppsCount `r"
- #$ApplyResult = ApplyBoldonJamesServiceEndPoint $RootSite.URL $EndPointURL
- $ApplyResult = ApplyEndPointUsingIE $EndPointURL $RootSite.URL
- if($ApplyResult[0] -eq $true -and $ApplyResult[1] -eq $True)
- {
- $SuccessCount++
- $RootSite.URL + "`tTrue`tTrue" | Out-File $BJReportPath -Append
- }
- elseif($ApplyResult[0] -eq $true -and $ApplyResult[1] -eq $false)
- {
- $FailedCount++
- $RootSite.URL + "`tTrue`tFalse" | Out-File $BJReportPath -Append
- }
- elseif($ApplyResult[0] -eq $false -and $ApplyResult[1] -eq $true)
- {
- $FailedCount++
- $RootSite.URL + "`tFalse`tTrue" | Out-File $BJReportPath -Append
- }
- elseif($ApplyResult[0] -eq $false -and $ApplyResult[1] -eq $false)
- {
- $FailedCount++
- $RootSite.URL + "`tFalse`tFalse" | Out-File $BJReportPath -Append
- }
- }
-
- }
- else
- {
- Write-Host -ForegroundColor Red "No site collection found in the web application...."
- }
- }
- }
- else
- {
- Write-Host -ForegroundColor Red "No web application found in the farm, terminating the execution.."
- }
- }
- elseif($UserOption -eq 1)
- {
- $WebAppAccepted = $false
- while($WebAppAccepted -ne $true)
- {
- $WebAppURL = Read-Host -Prompt "Please Enter Web Application URL"
- if(($WebApplication = Get-SPWebApplication $WebAppURL -ErrorAction SilentlyContinue) -ne $null)
- {
- Write-Host -ForegroundColor Green "Web Application URL has been accepted..."
- $WebAppTitle = $WebApplication.Name.ToString().Replace(" ","_")
- $WebAppAccepted = $true
- }
- else
- {
- Write-Host -ForegroundColor Red "Invalid input, please provide valid Web Application URL"
- }
- }
- if($WebAppAccepted -eq $true)
- {
- $BJReportPath = $ScriptPath + "\" + "WebApplication_" + $WebAppTitle + "_BoldonJamesActivation_" + $ScriptDate + "_" + $ScriptTime + ".csv"
- "Site URL`tFeature Activated?`tEndPoint Applied?" | Out-File $BJReportPath
- $SiteCollections = Get-SPSite -Limit All -WebApplication $WebApplication -ErrorAction SilentlyContinue
- $SiteCollectionsCount = ($SiteCollections | Measure).Count
- if($SiteCollectionsCount -ge 1)
- {
- ForEach($RootSite in $SiteCollections)
- {
- $SiteCounter++
- Write-Host -ForegroundColor DarkMagenta "Processing site no. " -NoNewline
- Write-Host -ForegroundColor Cyan "$siteCounter out of $SiteCollectionsCount "
- #$ApplyResult = ApplyBoldonJamesServiceEndPoint $RootSite.URL $EndPointURL
- $ApplyResult = ApplyEndPointUsingIE $EndPointURL $RootSite.URL
- if($ApplyResult[0] -eq $true -and $ApplyResult[1] -eq $True)
- {
- $SuccessCount++
- $RootSite.URL + "`tTrue`tTrue" | Out-File $BJReportPath -Append
- }
- elseif($ApplyResult[0] -eq $true -and $ApplyResult[1] -eq $false)
- {
- $FailedCount++
- $RootSite.URL + "`tTrue`tFalse" | Out-File $BJReportPath -Append
- }
- elseif($ApplyResult[0] -eq $false -and $ApplyResult[1] -eq $true)
- {
- $FailedCount++
- $RootSite.URL + "`tFalse`tTrue" | Out-File $BJReportPath -Append
- }
- elseif($ApplyResult[0] -eq $false -and $ApplyResult[1] -eq $false)
- {
- $FailedCount++
- $RootSite.URL + "`tFalse`tFalse" | Out-File $BJReportPath -Append
- }
- }
-
- }
- else
- {
- Write-Host -ForegroundColor Red "No site collection found in the web application...."
- }
- }
- }
- elseif($UserOption -eq 0)
- {
- $SiteAccepted = $false
- while($SiteAccepted -ne $true)
- {
- $SiteCollURL = Read-Host -Prompt "Please Enter Site Collection URL"
- if(($SiteCollection = Get-SPSite $SiteCollURL -ErrorAction SilentlyContinue) -ne $null)
- {
- Write-Host -ForegroundColor Green "Site Collection URL has been accepted..."
- $SiteTitle = $SiteCollection.RootWeb.Name.ToString().Replace(" ","_")
- $SiteAccepted = $true
- }
- else
- {
- Write-Host -ForegroundColor Red "Invalid input, please provide valid Site Collection URL"
- }
- }
- if($SiteAccepted -eq $true)
- {
- $SiteCounter++
- #Write-Host "Calling function to activate Boldon James"
- #$ApplyResult = ApplyBoldonJamesServiceEndPoint $SiteCollURL $EndPointURL
- $ApplyResult = ApplyEndPointUsingIE $EndPointURL $SiteCollection.URL
- if($ApplyResult[0] -eq $true -and $ApplyResult[1] -eq $True)
- {
- $SuccessCount++
- Write-Host -ForegroundColor Magenta "Feature Activation: " -NoNewline
- Write-Host -ForegroundColor Green "Passed"
- Write-Host -ForegroundColor Magenta "Applying EndPoint: " -NoNewline
- Write-Host -ForegroundColor Green "Passed"
- }
- elseif($ApplyResult[0] -eq $true -and $ApplyResult[1] -eq $false)
- {
- $FailedCount++
- Write-Host -ForegroundColor Magenta "Feature Activation: " -NoNewline
- Write-Host -ForegroundColor Green "Passed"
- Write-Host -ForegroundColor Magenta "Applying EndPoint: " -NoNewline
- Write-Host -ForegroundColor Red "Failed"
- }
- elseif($ApplyResult[0] -eq $false -and $ApplyResult[1] -eq $true)
- {
- $FailedCount++
- Write-Host -ForegroundColor Magenta "Feature Activation: " -NoNewline
- Write-Host -ForegroundColor Red "Failed"
- Write-Host -ForegroundColor Magenta "Applying EndPoint: " -NoNewline
- Write-Host -ForegroundColor Green "Passed"
- }
- elseif($ApplyResult[0] -eq $false -and $ApplyResult[1] -eq $false)
- {
- $FailedCount++
- Write-Host -ForegroundColor Magenta "Feature Activation: " -NoNewline
- Write-Host -ForegroundColor Red "Failed"
- Write-Host -ForegroundColor Magenta "Applying EndPoint: " -NoNewline
- Write-Host -ForegroundColor Red "Failed"
- }
- }
- #$BJReportPath = $ScriptPath + "\" + "SiteCollection_" + $SiteTitle + "_BoldonJamesActivation_" + $ScriptDate + "_" + $ScriptTime + ".csv"
- }
- Write-Host -ForegroundColor Green "Script execution completed..."
- Write-Host -ForegroundColor Magenta "Please find below summary:"
- Write-Host -ForegroundColor Cyan "Total no. of sites processed: $siteCounter"
- Write-Host -ForegroundColor Green "No. of sites successful: $successCount"
- Write-Host -ForegroundColor Yellow "No of sites failed: $failedCount"
- if($UserOption -eq 1 -or $UserOption -eq 2)
- {
- Write-Host -ForegroundColor DarkCyan "Find the detailed report at $BJReportPath ..."
- }
- Write-Host -ForegroundColor Cyan "=================================================="
-
- }
- else
- {
- Write-Host -ForegroundColor Red "Scope selection was not valid, terminating the exectuion..."
- Return
- }
- }
- else
- {
- Write-Host -ForegroundColor Red "SharePoint Snapin could not be loaded, terminating the execution..."
- }
-
-
- #$url= Read-Host 'Enter the Site Collection URL'
- #$SCServiceEndpointurl= Read-Host 'Enter the SharePoint Classifier Service Endpoint URL'
Note
Before running the script, change the domain at line 136 in the script [shown below].
$myDomain = “yourdomain.com”
Inputs
- The script prompts for the first input, which is selecting scope. It provides us 3 options, namely Site, Web Application and Farm. Based on the need, we can select the appropriate option.
- Next input required is Boldon James Classifier Web Service URL. We need to provide URL till .svc. For example - http://bj-classifier.domain.com:8080/ClassifierWCFService/ClassifierWCFService.svc
- Third input will be asked, if we select an option “Site” or “Web Application” for the first input. If the option selected was “Site”, it will ask for the site collection URL and if “Web Application” was selected, it will ask for Web Application URL.
If we provide any invalid input, the script will prompt again, until it receives a valid input. Once it receives all the valid inputs, it will take care of remaining task and upon the completion of execution, it will show us the summary. For more detailed reports [if we selected “Site” or “Web Application” option], it will generate a CSV file in the same directory, where the script is placed and display the path of the output CSV in PowerShell Window.
That’s it. We can just go to site collection and verify whether it did the job or not.
I’m currently working on preparing the script for applying the endpoint on the document libraries and shall be posting, once it’s ready.
Thanks for reading and using the script.