Posts

Showing posts from 2019

Azure: Bastion Service Introduction

Image
Azure Bastion is a fully managed PaaS service enabling SSH and RDP access to your Virtual Network (Jump-Server/Bastion Host) resources through Azure Portal. In this article, we will discuss how can we configure Azure Bastion service to enable secure SSH or RDP access to our Virtual Network resources without needing an IaaS VM with a public IP exposed to the internet. The service at the writing of this post is in preview mode. Below is the sample architecture diagram of using Azure Bastion service. As you could have noticed, Azure Bastion service enables connection to the Virtual Machines in the Virtual Network over SSL, port 443, directly from Azure portal. The public preview of the service is limited to the following Azure Public regions. West US East US West Europe South Central US Australia East Japan East Though no particular reason I will be deploying my resources in the South Central US region. Now let’s explore how to configure Azure Bastion Service...

PowerShell: Multiline Comments

Image
Comments play an important role in writing readable code and maintaining the working software. In PowerShell, comments begin with a  Hash  ( # ) sign.  #  can be included anywhere but inside a string to make the rest of the line a comment. # This a comment. Single line comment. Get-Service   - Name BITS How to add multi-line comments in PowerShell? Powershell has come a long way since the public release of PowerShell version 1 in 2006. From version 2 onwards PowerShell supports multiline comments. PowerShell multiline comments begin with ' <# ' and ends with ' #> ' <# This is also commented.  Multi-line comment. #> Get-Process   - Name explorer

PowerShell: Azure Traffic Manager Profiles with Endpoint details

Image
Here is a PowerShell snippet to query Azure Traffic Managers with endpoint details. The script uses PowerShell Az modules so that it is compatible with both Standard PowerShell and PowerShell Core. The script uses the Azure Resource Graph query to get the resource details. $ trafficManagerQuery = " where type =~ 'microsoft.network/trafficmanagerprofiles' " $ trafficeManagers = Search-AzGraph - Query $ trafficManagerQuery $ resultTM = @ () foreach ($ tm in $ trafficeManagers ) {      $ endPoints = $ tm.properties.endpoints      foreach ($ endPoint in $ endPoints )      {          $ edTagetQuery = " where id =~ '{0}' " -f $ endPoint.properties.targetResourceId          $ endTarget = Search-AzGraph - Query $ edTagetQuery          $ customObjProperties = [ ord...

PowerShell: Check Windows OS Version

Image
Here is a PowerShell script to get the OS details of Windows Machines. The script makes use of CIM cmdlets. The script also provides uptime information. function Get-cOSInfo { <# . SYNOPSIS PowerShell script to collect OS information . DESCRIPTION Get the OS, edition, and build version of Windows Servers . PARAMETER ComputerName Accepts a list of computer names or IP addresses . EXAMPLE Get-cOSInfo -ComputerName Server1,server2 . LINK https://www.posh-scripts.in.net/2019/08/check-windows-os-version.html #> [ CmdletBinding ()] Param ( # A computer name or list of computer names [ Parameter ( Mandatory = $ False , ValueFromPipelineByPropertyName = $ true , Position = 0 )] [ string []]$ ComputerName = ' localhost ' , [ Parameter ( Mandatory = $ False , ValueFromPipelineByPropertyName = $ false , Position = 1 )] [ ValidateNotNull ()] [...

Azure: Learning Resources

Image
image credit: Microsoft I am trying to curate some useful resources to get started with Azure. As Azure is a platform that is consistently evolving I hope I can keep up with the changes in real-time and share that info with all through this post. Official Documentation Azure Resources Architecture References Microsoft Learn Portal Hands-On Labs Azure Portal Navigation VM and Compute Azure Networking Concepts Azure Storage Accounts Azure Administration for AWS Admins Edx Azure Courses Azure Certifications

PowerShell and Azure Resource Graph

Image
Introduction On today’s post, I want to discuss a service introduced on the Microsoft Azure platform fairly recently, Azure Resource Graph . Azure Resource Graph service enables the administrators to explore resources in large scale deployment with relative ease across multiple subscriptions and management groups. Azure Resource Graph queries provide the following capabilities. Ability to query resources with complex filtering, grouping, and sorting by resource properties. Ability to iteratively explore resources based on governance requirements and convert the resulting expression into a policy definition. Ability to assess the impact of applying policies in a vast cloud environment. Ability to detail changes made to resource properties (preview). Azure Resource Graph service was announced during 2018’s Microsoft Ignite Conference. The service coupled with cross-platform PowerShell Az module enables the administrators to discover resources much faster compared to...