26.3 C
Dubai
Friday, December 2, 2022

Adding SPSiteURL in SharePoint 2013 site – Automation ExtendASP

Every SharePoint site you create using ExtendASP Control Panel adds the SharePoint site only to the default zone.

You need to add a HTTPS url to every site you create and place it on the internet zone , so that users external users can access it.

Open Powershell in Sharepoint 2013 Server – (Adding Sharepoint 2013 Snapin)

Add-PSSnapin Microsoft.SharePoint.PowerShell

You need to run

Set-SPSiteURL -Identity “http://demo.careexchange.in/” -Zone Internet -Url “https://demo.careexchange.in/”

 

To automate all sites to be placed on internet zone – Add a Scheduled task as below –

Save to .ps1 and run it every 5 mins

######

Add-PSSnapin Microsoft.SharePoint.PowerShell

Get-SPSite | foreach{Set-SPSiteURL -Identity $_.URL -Zone Internet -Url ($_.Url -replace “http”, “https”)}

######

Note – if you want to skip any sites from not applying this in the same sharepoint server – Like default sites

#####

Add-PSSnapin Microsoft.SharePoint.PowerShell

Get-SPSite | Where-Object{($_.Url -notlike “http://defaultsite1”) -and ($_.Url -notlike “http://defaultsite2”) -and ($_.Url –notlike http://defaultsite3.domain.com)} | foreach{Set-SPSiteURL -Identity $_.URL -Zone Internet -Url ($_.Url -replace “http”, “https”)}

#####

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?