SharePoint 2010 – System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

  I am sure many would have experienced this issue while connecting to a SharePoint site from an Asp.Net application. You normally would get these errors: 1. System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.SharePoint.Utilities.SPUtility.HandleAccessDenied(Exception ex) at Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32…

5

"Set-AuthenticodeSignature" returns Unknown Error while registering the script with a certificate

Recently I have been working on a PowerShell Project where I needed to sign the scripts with the code signing certificates (the ExecutionPolicy was set to “AllSigned”). I did this before many times without a single problem/error. But this time when I tried to sign the scripts with the certificates I got the “Unknown” error…

3

What is “Name Decoration” or “Name Mangling”?

Some of my partners, I have worked, have experienced the errors, while calling a native DLL (written in C++) from a managed .NET application using PInvoke; and that inspired me to write this blog. The one of the most common errors is "System.DllNotFoundException" occurred in the <application>. Unable to load the dll and the specified…


How to list all the sub-sites and the site collections within a SharePoint web application using Windows Powershell

Recently, I worked on a partner’s request for enumerating all the sub-sites and the site collection within a SharePoint web application. If you want to do the same thing, may this be useful for you. Windows Powershell has made it so easy to work/administer with several Microsoft products like, SharePoint, SQL Server, Exchange Server etc.,…

11

How to add the Windows Powershell assembly / namespace in .NET

I thought it would be easy to create a PSSnapIn using .NET. But that wasn’t the case initially. When I first created a .NET project for creating a PSSnapIn and wanted to work with “Cmdlet” and “PSSnapIn”; I couldn’t add/find the assembly “System.Management.Automation” in my the project. Without this you can’t create your snap-in. The…

2

How to connect to SQL Server from a Windows Mobile Emulator

Sometime back, I worked with a partner who had been getting SQLExceptions while connecting the SQL Server database from a Windows Mobile Emulators. If you have been getting the same problem/errors, you can try the following steps. Here are the steps you will have to perform for connecting the SQL Server database: 1. Enable the…

3

Windows PowerShell and .NET Together (creating the object)

By this time, you are probably aware of the fact that the Windows PowerShell integrates with the Microsoft .NET Framework very well and leverages it power fully. So, if you are new to PowerShell and don’t know much about PowerShell scripting, you can still go ahead and use its power by relying on the old…

1

How to check programmatically if a website is running

Recently, I got a request from one of my partners to check if a particular website is running or not and this has to be done from a windows service; which should be checking automatically at a given interval once started. Well, you can use WebRequest and WebResponse Classes (under namespace System.Net) to first create…

2

The power of PowerShell: Working with ADO.NET Data Services and JSON

A very interesting article to read on working with JSON data with PowerShell on “gduthie” blogs: ADO.NET Data Services, JSON, and PowerShell http://blogs.msdn.com/gduthie/archive/2009/04/08/ado-net-data-services-json-and-powershell.aspx

1

Useful resources on SQL Server Compact Edition

SQL Server Compact Edition Concepts A Technical Comparison of Replication and Remote Data Access Features in SQL Server 2005 Mobile Edition 3.0 Architecting Disconnected Mobile Applications Using a Service Oriented Architecture Q&A on OCS & Sync Services for ADO.NET How Remote Data Access Works Planning for Remote Data Access Implementing Remote Data Access Using Merge…

1