Category: PowerShell

How To Install The Azure AD PowerShell Module

This blog post will explain how to Install the Azure AD PowerShell Module. It is very simple to do, but I found this documentation a little difficult to find so I am blogging it here so that I can easily find it! Firstly make sure to start PowerShell as Administrator: The next step is to…



Where is my O365 mailbox hosted?

I was wondering as part of my testing on my private O365 tenancy, how I could find out where in the world my mailbox was being hosted.  It is actually relatively simple to do – all you need to do is open PowerShell and get a connection to Exchange Online:

If you run the…



Enable Clutter On Office 365 With PowerShell

If you need to enable Clutter for a single user (or even the whole organisation!) on O365, then it can be done very easily with PowerShell:

Easy peasy 🙂



AD: Find Active Directory Lockouts

Recently I had a customer that kept getting their account locked out, due to someone try to brute force their way into the company by using the OWA portal that is hosted by their on-premise Exchange Server.  Initially trying to find this information was quite tricky and I found a really useful set of PowerShell…



PowerShell: Connect Virtual Machines to a New Switch

I have decided to expand on this post a little: https://www.remilner.co.uk/2017/02/22/powershell-list-all-hyper-v-virtual-machines-along-with-the-connected-switch/, which explains how to list all Hyper-V Virtual Machines along with the connected Virtual Switch.  I ran into an issue today, where one of the Virtual Interfaces on my Cisco UCS had an issue and therefore required to flip all my Virtual Machines onto…



PowerShell: Check if O/S is 32 or 64 bit

I was on a client site doing a PowerShell script for an application that could potentially be deployed to either a Windows 7 32-bit or a Windows 7 64-bit, and I was looking for a very simple method of checking to see whether the Operating System was 32-bit or 64-bit, as that would dictate the…



SharePoint Online Group Permissions

Recently, I wanted to dig into whom had full access to one of our SharePoint sites.  I noticed that by default it seems that the groups named Company Administrator and SharePoint Service Administrator get access to the SharePoint site by default.  This was a potential security risk, given the sensitive nature of some of the…



PowerShell: Get all AD users last logon time

If you like me sometimes get asked to clean up some stale AD accounts, then on of the easiest ways to do this is by finding out when people last logged and authenticated against a Domain Controller.  Usually I take a stance of if the last logon date is more than a year ago, then…



PowerShell: List All Hyper-V Virtual Machines Along With The Connected Switch

Here is a useful PowerShell script, that I have used and is fairly easy to figure, but as ever I like to make a note of it somewhere so this is a good a place as any.  So my issue was initially that I wanted to find out which of my VM’s were connected to…



PowerShell Script to connect iSCSI Targets

On my old blog, I previously posted this script which I haven’t used in a while but really needed this script to connect four Hyper-V hosts to some iSCSI storage.  Doing the process manually would have taken me about an hour of work, and in the future if the hosts needed to be rebuilt then…