Automatically initialize variables in Azure Functions

  When working with Azure Functions and passing parameters in the HTTP request, this piece of Powershell comes in handy every time. $Request.Query.GetEnumerator() | ForEach-Object { New-Variable -Name $_.Key -Value $_.Value } This will make a variable from each parameter you pass in the request.So for example; If you request the following Azure functions URL:https://darryl.azurewebsites.net/api/Get-Info?code=WrUum7c6ZM3YyyjY4O6Im8YtL7asx0ShxXJ5pUCDaL4832lsQYZkng==&myname=darryl […]

Read More

Kill TCP connection with Powershell

Sometimes you have an application that keeps connections open while they should be closed. Because Windows does not seem to have the capability to kill an connection without killing the whole process we’ll to use a 3rd party tool called cports.exe. Download here: https://www.nirsoft.net/utils/cports-x64.zip   $ProcessName= "BackgroundTransferHost" $State = "CloseWait " while ($true) { sleep -Seconds […]

Read More

Windows Server 2016 Update settings

In Windows Server 2016 there are no GUI options available to change the update behavior. In this blog I was outline the different ways to change the Windows Server 2016 Update settings. Windows Server 2016 Update settings Windows always looks at registry keys located in the following hive: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU Typically there is a key named […]

Read More

No disks with supported bus types found to be used for S2D

I had some HP DL380’s to test Storage Spaces Direct (S2D) and walked into the following error: Enable-ClusterStorageSpacesDirect : No disks with supported bus types found to be used for S2D At line:1 char:1 + Enable-ClusterStorageSpacesDirect + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (MSCluster_StorageSpacesDirect:root/MSCLUSTER/…ageSpacesDirec    t) [Enable-ClusterStorageSpacesDirect], CimException     […]

Read More

Provisioning VM Networks

This script/Powershell functions can be used for (automatic) provisioning VM networks based on VLANs on existing Logical Network and switches in Virtual Machine Manager. Create VM Network Function: 1. Check if VLAN already exist 2. Create Network site in logical network and add VLAN 3. Enable VLAN on Uplink Port Profile 4. Create VM Network […]

Read More

Sample-SQL-Actions – SQL through SMA

Sample-SQL-Actions demonstrates how to create a SQL database connection and use this connection to execute commands on the database through SMA in Windows Azure Pack. Before running this workflow, you must create a Management Service (Windows Azure Pack) variable named ‘SQL_Connectionstring’ with the connectionstring to the SQL server. Example: “Server=SQL1;Database=TestDB;User ID=SQLuser;Password=Passw0rd;” http://gallery.technet.microsoft.com/scriptcenter/SMA-Sample-SQL-Actions-9cdfefa4 <#    Sample-SQL-Actions […]

Read More