Posts

PowerShell: How can I list/document all the items in my azure subscription?

The following script will create an Excel file with each Resource Group as a tab. First, I created a password file to reference from the script (no passwords in clear text please) "xxxx" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "C:\Temp\Password.txt"  Here is the function - it will create seperate CSV files per resource group and then merge them intoa a single Excel file at the end. BTW, you may want to change the hard coded directories, username and filenames as required..... enjoy # create a function to merge the csv files we have created Function Merge-CSVFiles  {                  Param(                                  $CSVPath = "C:\csv\", ## Soruce CSV Folder                                ...

Visual Studio: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project

I encountered this issue when trying to compile some old code. I tried to download the SDK, but there are no active links. My resolution was to install Visual C++' support in Visual Studio 2015 by re-running the installer.​ Its like killing a fly with a hand-grenade (3GB install), but as least it resolved the problem.

IE11 - Critical Error: Object doesn't support property or method 'addEventListener'

Add this code within the body tag and all is good.  <script type="text/javascript">         /* IE11 Fix */         if (typeof (UserAgentInfo) != 'undefined' && !window.addEventListener) {             UserAgentInfo.strBrowser = 1;         }     </script>​

Backup-SPSite : You must specify a filename for the backup file.

I followed the backup instructions from  here  to backup my site collection but I encountered the following error: You must specify a filename for the backup file That was strange as I have set the -Path parameter. The resolution is that the path MUST BE VALID . In my case , I was missing an underscore.

SharePoint 2010: Unable to open Central Administration

I have been trying to install a SharePoint 2010 development environment on my local Windows 10 laptop (dont ask why) and I have finally been able to load Central Admin. Here are the issues I encountered: 1. Ensure you have Windows 10 Pro - you will need to activate Windows Auth before you install 2. Run the following script if Central Admin is start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ManagementScriptingTools;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibili...

SharePoint 2010 on Windows 10: Solving COMException / Unknown error (0x80005000)

Image
This is not a problem I expected to solve, but it happened anyway. A client is using SharePoint 2010 and I need a local development farm. I started with the usual configuration requirements: Add <Setting Id="AllowWindowsClientInstall" Value="True"/> to the Setup config Created a script to make a new configuration database so that I dont have to join a domain $secpasswd = ConvertTo-SecureString "MyVerySecurePassword" -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ("mydomain\administrator", $secpasswd) $guid = [guid]::NewGuid(); $database = "spconfig_$guid" New-SPConfigurationDatabase -DatabaseName $database -DatabaseServer myservername\SharePoint -FarmCredentials $mycreds -Passphrase (ConvertTo-SecureString "MyVerySecurePassword" -AsPlainText -force) The PowerShell script was generating the error. The solution is simple - you need to enable IIS 6.0 Management Compat...

C#: How do I call an API from a console application?

I have used the following code to call an API and pass in some parameters in the request header. Have a read  here  about the Encoding.GetEncoding(1252) . private static string ExecuteAPI(string url, Dictionary<string, string> parameters, string method = "POST", string body = " ", int timeOut = 180000) {     var request = (HttpWebRequest)WebRequest.Create(url);     request.Method = method;     foreach (var param in parameters)     {         request.Headers.Add(param.Key, param.Value);     }     if ((method == "POST") || (method == "PUT"))     {         if (!string.IsNullOrEmpty(body))         {             var requestBody = Encoding.UTF8.GetBytes(body);             request.ContentLength = requestBody.Length;             request.ContentT...