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
Export Content Types using PowerShell - SharePoint
clear
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell
####################### ENVIRONMENT VARIABLES #######################
$contentTypeSourceWeb = "http://webapp/sites/contenttypehub" #Site Collecton
# The exported content type is stored in the XML file
$xmlFilePathForContentType = "C:\Script-SiteContentTypes.xml"
#####################################################################
#Content Type group you are looking to export
$contentTypeGroupName = "Custom Content Types"
$sourceWeb = Get-SPWeb $contentTypeSourceWeb
#Create Export File
New-Item $xmlFilePathForContentType -type file -force
#Export Content Types to XML file
Add-Content $xmlFilePathForContentType "<?xml version=`"1.0`" encoding=`"utf-8`"?>"
Add-Content $xmlFilePathForContentType "`n<ContentTypes>"
$sourceWeb.ContentTypes | ForEach-Object {
if ($_.Group -eq $contentTypeGroupName) {
write-host "Adding content type to file."
Add-Content $xmlFilePathForContentType $_.SchemaXml
}
}
Add-Content $xmlFilePathForContentType "</ContentTypes>"
$sourceWeb.Dispose()
write-host "Completed"
Saturday, December 30, 2017
Sunday, November 19, 2017
Enable Wifi on Ubuntu Machine
Issue: The wifi is not working on Ubuntu machine. The network options shows
'Wifi Disabled'
Solution:
1. Make sure your hardware wifi switch is enabled. Usually from keyboard you should be able to switch it on using Wifi symbol key (or with combination of function key and wifi key)
2. To verify if the wifi is blocked by hard or soft switches, you can by running th below command from terminal
Command:
user@machine:~$ rfkill list all
Output:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: brcmwl-0: Wireless LAN
Soft blocked: no
Hard blocked: no
The output shows if soft or hard switches are blocking. If all of them shows no as shown above, that indicates that all look good. If not then see which one shows yes and use the below command.
Command:
user@machine:~$ sudo rfkill unblock all
Enter password and this will unblock the soft switch
If option 'hard blocked' in the output shows yes, that means the machine wifi hardware is disabled and you can enable it as described in point 1 above.
'Wifi Disabled'
Solution:
1. Make sure your hardware wifi switch is enabled. Usually from keyboard you should be able to switch it on using Wifi symbol key (or with combination of function key and wifi key)
2. To verify if the wifi is blocked by hard or soft switches, you can by running th below command from terminal
Command:
user@machine:~$ rfkill list all
Output:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: brcmwl-0: Wireless LAN
Soft blocked: no
Hard blocked: no
The output shows if soft or hard switches are blocking. If all of them shows no as shown above, that indicates that all look good. If not then see which one shows yes and use the below command.
Command:
user@machine:~$ sudo rfkill unblock all
Enter password and this will unblock the soft switch
If option 'hard blocked' in the output shows yes, that means the machine wifi hardware is disabled and you can enable it as described in point 1 above.
Subscribe to:
Posts (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...
-
While Working on a VisualWebPart with Telerik Controls I got a Security Exception. I searched many blogs and articles, and found some i...
-
While working for an utility to redirect the tasks with some custom functionality I had to search for an option to bring the WorklistItems (...
-
Trying to use the Oracle Data Provider for .NET ( ODP.NET ) with Entity Framework (EF) results in the following error: System.Data.Pro...