30 C
Dubai
Thursday, November 21, 2024

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
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a 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?