clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell #################################### ENVIRONMENT VARIABLES ######################################### $WebApplicationURL = "https://webappUrl" ## eg: "http://spddwebapp" $RecordCenterSiteColls = @("SiteColl1","SiteColl2") #################################################################################################### $ServiceURL = "_vti_bin/officialfile.asmx" write-host "Opening web app object." $WebApp = Get-SPWebApplication $WebApplicationURL function AddSendToConnection($sendServiceURL, $siteName ) { #Get the Web Application $SPOfficialFileHost = New-Object Microsoft.SharePoint.SPOfficialFileHost #Set Send to Options# #Send to Connection Name $oFName = $siteName + " Send To Conenctor" $SPOfficialFileHost.OfficialFileName = $oFName #Send to Target location #write-host "Office File Url - $offFileUrl" $SPOfficialFileHost.OfficialFileUrl = $sendServiceURL $SPOfficialFileHost.ShowOnSendToMenu = $true #Send to Operation $SPOfficialFileHost.Action=[Microsoft.SharePoint.SPOfficialFileAction]::Move $SPOfficialFileHost.Explanation = "Send to connection for documents move to other record site collections." $WebApp.OfficialFileHosts.Add($SPOfficialFileHost); $WebApp.Update() } write-host "Loop through all receiver site collections." foreach ($rSite in $RecordCenterSiteColls) { $fullSiteURL = $WebApplicationURL + "/sites/" + $rSite $sendServiceURL = $fullSiteURL + "/" + $ServiceURL write-host "Send service URL - $sendServiceURL" AddSendToConnection $sendServiceURL $rSite write-host "Succesfully added Send To Connector for $rSite" } write-host "Completed"
Thursday, January 11, 2018
Create Send To Connector using PowerShell - SharePoint
Subscribe to:
Post Comments (Atom)
Access to XMLHttpRequest at 'from origin has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. .net core angular
Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...
-
We had an issue while updating the datafield values without executing the action in the application form. If we use ProcessInstance Updat...
-
Trying to use the Oracle Data Provider for .NET ( ODP.NET ) with Entity Framework (EF) results in the following error: System.Data.Pro...
-
Issue: LDAP Query not pulling all the Active Directory Groups (including subgroups) available in the given domain. Solution: To retriev...
No comments:
Post a Comment