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 […]
Tag: Powershell
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 […]
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 […]
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 […]
Windows Azure Pack Tool
Windows Azure Pack Tool enables you to execute tasks through a simple menu. – Download here – Download here – Download here – Download here –
Get Blocksize of Cluster Shared Volumes
WMI command to get the blocksize / clustersize of disks and Cluster Shared Volumes. get-wmiobject win32_volume -ComputerName . | FT Name,Blocksize You could also use this within a Powershell script.
Configure iSCSI Initiator Target Portals with Powershell
By default when you discover target portals with the iSCSI Initiator, the default values will be on “Default” for Local adapter and Initiator IP. To make sure the initiator is using the right IP addresses and NICs, and overcome connections problems, you will need to set the local adapter and initiator IP static. Ofcourse you […]
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 […]
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 […]
Converting VM’s from VMware to Hyper-V in seconds (Part 3)
Converting VM’s from VMware to Hyper-V in seconds (Part 1) Converting VM’s from VMware to Hyper-V in seconds (Part 2) Converting VM’s from VMware to Hyper-V in seconds (Part 3) In the previous 2 parts I explained what we can do with the Netapp conversion technology, in this part I will show how it’s done. […]