Get-AdUser -Filter {Multiple Filters Complex } -Properties | Export to CSV

#Import AD modules

import-module servermanager
Add-WindowsFeature -Name “RSAT-AD-PowerShell” -IncludeAllSubFeature

#List AD user accounts and show DisplayName, Email, Title and export to CSV

Get-ADUser -Filter * -Properties DisplayName, EmailAddress, Title | select DisplayName, EmailAddress, Title | Export-CSV “C:\temp\Email_Addresses.csv”

#List AD user accounts and show DisplayName, Email, Title and export to CSV. Advanced filter to show ENABLED accounts only

Get-ADUser -Filter {Enabled -eq $true} -Properties DisplayName, SamAccountName, EmailAddress, Enabled, DistinguishedName | select DisplayName, SamAccountName, EmailAddress, Enabled, DistinguishedName | Export-CSV “C:\temp\Email_Addresses_allusers.csv”

#List AD user accounts and show DisplayName, Email, Title and export to CSV. Advanced filter to show ENABLED accounts only and email address ending

Get-ADUser -Filter {(Enabled -eq $true) -And (EmailAddress -Like “*”)} -Properties DisplayName, SamAccountName, EmailAddress, Enabled, DistinguishedName | select DisplayName, SamAccountName, EmailAddress, Enabled, DistinguishedName | Export-CSV “C:\temp\Email_Addresses_testdomain.csv”

Get a list of active computers which have logged on to the domain in the last 7 days

# Trying to work out is servers, laptops or desktops have been decommissioned
# Try this script
# Get a list of active computers which have logged on to the domain in the last 7 days

$Date = (Get-Date).AddDays(-7)
Get-ADComputer -Filter {LastLogonDate -gt $Date} | Select distinguishedName

# Credit to Richard Mueller – MVP Enterprise Mobility (Directory Services)

Azure and Containers

What is a container?
A container is a live and running copy of an image which may have been customised.
An image is a read only copy of an image before it was running as a container

How do you implement containers in Azure

Two options, containers we deploy ourselves and containers Microsoft manage
Container can be running on Windows 2016 or Linux OS
CPU and Ram assigned to each individual container

Containers Limited security risk?
Microsoft offers Hyper-V running containers for those concerned
Azure container covers this way.
Others offer shared application containers.

Notes around Docker?
A docker file is like a script to build the container which takes a source and makes an app on an image, which makes a container as its running.

Docker has other tools: Docker toolbox, Docker client and Kitematic (GUI client)

How to Install Docker for Windows

Quick install guide :
1) Navigate to
On the Install Docker for Windows page, click Get Docker for Windows (Stable).
3) When prompted whether to run or save Docker for Windows Installer.exe, click Run.
4) Once the installation completed, click Close and log out.

When you make a mistake deploying a docker-machine .. Ie.. Forget to enter a region… But the machine builds and you enter an error state.
Start again by removing the docker-machine

Launch CMD as admin : docker-machine rm “machine name”


Kubernetes a management tools to for Docker. An alternative Docker Swarm for large scale
Deploy Kubernetes cluster for Linux containers

From <>

DCOS getting started with Kubernetes

Set Up Your Microsoft Azure Environment With PowerShell

Step 1 : Install Command Line Tool For PowerShell

Step 2: Launch PowerShell as Administrator

Type in the following

# get the Azure RM module installed first

Install-Module AzureRM

# import the module for use

Import-Module AzureRM


Step 3: Getting started with IaaS & PowerShell scripts

#Create a resource group

New-AzureRmResourceGroup -Name Project1ResourceGroup -Location “West Europe”

#Create a new subnet and store in a variable

$Project1Subnet1 = New-AzureRmVirtualNetworkSubnetConfig -Name Project1Subnet1 -AddressPrefix “”

#Create new network and add the subnet stored in variable

$virtualNetwork = New-AzureRmVirtualNetwork -Name ProjectNetwork -ResourceGroupName Project1ResourceGroup -Location “West Europe” -AddressPrefix “” -Subnet $Project1Subnet1

#add additional subnet to the network

Add-AzureRmVirtualNetworkSubnetConfig -Name Project2Subnet2 -VirtualNetwork $virtualNetwork -AddressPrefix “”

$virtualNetwork | Set-AzureRmVirtualNetwork



Sign up to GitHub.. Create your own repository

Git Hub Desktop to grab a bunch of files… Full Git hub desktop to sync

Microsoft Azure Virtual Machines and Networking

Azure VMs

VMs types and sizes

Only supported virtual machine type in Azure is “VHD”. VHDX is not currently supported.

Note : Managed disks are now preferred to use instead of storage accounts in legacy Classic Azure

Before migrating VMs to Azure, identify the workloads are supported in a virtual machine. 3rd party vendors may only support their software as PaaS instead of IaaS

VM availability.

2x VMs are better than 1x. I.E your solution is much better if its scalable. Try to utilise VMs in an “availability set”. Servers suitable for availability sets are identical machines file wise. This would give you high availability in the event of failure.

Alternatively, if you only want 1x a virtual machine (example domain controller or DNS), go for solid state (disks with an “s” in the name) and Microsoft have a better SLA for up time.

Managed Disks or Unmanaged Disks
Managed disks go with the VMs,
Try the Market Place for machine images

Scale sets
Scale sets provide VM auto scaling

  • Create rules for scaling
  • DSC config
  • Pure compute box with data at the backend
    i.e Stateless work loads
    Suggestion, for stateless servers, the backend database wont be SQL, it would be the Azure flat file or Azure Cosmos or some read/cache option.

Disk encryption and Azure Key Vault..thoughts
Requirement? Keys are stored in Azure key vault (secure area, no access).
But the drives aren’t physical, so to steal a physical disk would be very challenging to locate.

To steal an virtual drive and mount, its the administrator mistake? Lost or weak admin password?

Define the DNS server IP
Defining Peerings for vNETS. This allows routes between vNETS

Public IPs will fall in to a network security group for a default firewall. Its purely a basic firewall.

Use Market place to find a 3rd party firewall to lock down internet facing servers (fastest option)
Alternatively route via on prem firewall (slowest option) or route via another cloud firewall (second fastest)

Network Security Group
Inbound and Outbound security groups

By default network security groups have a public IP address and an RDP allow connection.

Network security groups can be assigned to a network card, a subnet or the subnet a load balancer sits within.

Cost : Networks and Network Security Groups are Free

Create your own route tables. Then you have options to assign routes to a subnet or a virtual machine.

Additionally configure the Windows Firewall settings on a virtual machine.

(My thoughts and opinions, are my own @stephenhackers)

Implementing Microsoft Azure Infrastructure Solutions – Overview

Azure – What are the options?

IaaS, PaaS & SaaS

IaaS – Virtual Servers in the Cloud.
Easiest/ Logical method of moving to the cloud is IaaS. Drag your on prem Virtual Machines in the cloud. Basically transferring your on prem virtual machines in to the Cloud (Azure).
In event of failure on prem option, to run in azure, or migrate to azure
Active Directory – Azure AD connect. In a Hybrid environment

PaaS – Azure App Service
Storage, back and recovery services
More advanced – AI – Audio to Text PaaS

Complete Software solution

What is the exam?
Exam : 70-533 Implementing Microsoft Azure Infrastructure Solutions.
Expect 1-4 questions are PowerShell based

In theory, you will need another exam to qualify for the certification MCSE Cloud

Why move to Azure?
DR solutions
Hybrid options
Cost saving option – Turning off services over night will massively save money IaaS.
Auto scaling
Pay As You Go : Azure for your dev environment


Location knowledge
Note : Geographic areas and some cost more to host and some have limited features.

West Europe would appear to be the best option for local businesses in Sunderland (UK).

But – Check features are available in a region.

Pricing Calculator / Estimator

Location to learn information

DevOPS : How to deploy to Azure .

Market Place : Search for products available on Azure

Azure Services / Categories
Compute, Networking, Data and Storage, Web & Mobile, Other services include AD, automation, logging, monitoring

Azure Portals
Or old world

Deployment methodologies
Visual studio or visual studio code (free option)
Resource templates. Json files

Log Analytics and ( Operations Management Suite )
Centralised location for gathering log information
Patch management view
Change management view
Resource monitoring

Thought : Could this be described as a new version of System Center, SCOM, WSUS, but a cloud version?


Resource Groups and RBAC
Setup Resource Groups & Tags
Setup Access Control (IAM) Roles (RBAC)

Basic PowerShell Commands

Networking and Providers
Location Providers – UK is London


AT&T NetBond, British Telecom, Colt, Equinix, InterCloud, Internet Solutions – Cloud Connect, Interxion, Jisc, Level 3 Communications, Megaport, MTN, NTT Communications, Orange, Tata Communications, Telecity Group, Telehouse – KDDI, Telenor, Verizon, Vodafone, Zayo Group+

From <>

Azure Virtual Networks
Choose the IP address spaces. Don’t use a subnet where you might duplicate your on prem servers.
Azure utilises some IPs .. So smallest subnet /29 subnet

Azure Load Balancer – Overview
Internal, Internet, Application Gateway, Traffic manager
SSL offload & WAF

Azure DNS
PaaS DNS is quite limited or Create a VM hosting VMs for internal DNS / Domain Controller.

Template Examples
Deploy to azure ( for speed, test it out at your own risk )

(My thoughts and opinions, are my own @stephenhackers)