February 26, 2018

SSH Port Forwarding example

In addition to my previous post about SSH tunneling. Here is another example of accessing web server in a restricted network. Plink.exe command-line tool will be used on Windows admin computer to access SSH Server.

February 19, 2018

Microsoft Azure - Migrate from classic to ARM

In this post I show how to migrate supported IaaS resource from classic deployment model to Azure Resource Manager. PowerShell will be used to achieve this task. Make sure that you are an administrator for your Azure subscription and your Azure region has enough available vCPUs resources (refer to ARM limits).

Items for migration:
TestRG1 - Virtual network (classic)
Testrg1sa - Storage account (classic)
TestVm1 - Virtual machine (classic)
TestVM19796 - Cloud service (classic)

February 16, 2018

PowerShell - Query MS SQL Server

This PowerShell script connects to SQL server, queries needed data, exports the results to the CSV file and then sends it via email.

# SQL Server connection string details, integration authentication is used.
$SQLConnectionString = "Server=SQLSERVER\InstanceName;Database=DatabaseName;Integrated Security=SSPI"
# Path to the file for exported data.
$File = "C:\Script\file.csv"
# SQL Query syntax itself.
$SQLQuery = "
select * from DB_Table_Name