Recently I was trying to connect to SharePoint Online site by using Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll using PowerShell by giving references like below:
- Add-Type -Path ‘E:\Bijay\Microsoft.SharePoint.Client.dll’
- Add-Type -Path ‘E:\Bijay\Microsoft.SharePoint.Client.Runtime.dll’
We wrote the script using Windows PowerShell ISE. But it was giving error like: cannot be loaded because the execution of scripts is disabled on this system
cannot be loaded because the execution of scripts is disabled on this system
We were using Windows 10 64-bit laptop. To resolve the issue, Open the PowerShell command prompt in Administrator mode and then run the below command. Once the command runs successfully RESTART the laptop once.
After restart the issue resolved for me.
You may like following PowerShell tutorials:
- Connect-PnPOnline : The ‘Connect-PnPOnline’ command was found in the module ‘SharePointPnPPowerShellOnline’
- Get SharePoint document library size using PowerShell
- Working with PowerShell Date Command (Get-Date)
- PowerShell cannot be loaded because running scripts is disabled on this system windows 10
- PowerShell reference variable
- SharePoint Online Automation: Upload Files Remotely to SharePoint Online Document Library using PowerShell
- Retrieve all list names and list guids from SharePoint online site using PowerShell
- SharePoint 2013 backup and restore using PowerShell
- Cannot be loaded because the execution of scripts is disabled on this system while running PowerShell for SharePoint online site
- How to check if file created last 24 hours using PowerShell?
- PowerShell find files modified in last 24 hours and PowerShell get last modified time of files in folder
I hope this SharePoint tutorial, we discussed how to fix error cannot be loaded because the execution of scripts is disabled on this system.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”