Posts Tagged: Powershell

PowerShell Get-History

20th February, 2020

One command that I love to use in PowerShell is Get-History. It retrieves all of the commands that you have run in this session. You can use the id and count parameters to pick a single command or a number of commands including and prior to the id e.g. Get-History -id 10 -count 5 gets […]

Efficient Lookups in PowerShell

21st November, 2019

When writing scripts in PowerShell we often need to do a lookup in another dataset. Of course one way is to use an external tool like Excel with VLOOKUP or SQL Server with its joins and produce a data set that can be used in PowerShell without any lookups, but sometimes this just isn’t practical. […]

Merging Two Office 365 Mailboxes

2nd October, 2018

There are many reasons why you may want to do this but probably the most likely is the “Leaver” scenario.  A common way of dealing with leavers is to simply convert their Mailbox to a Shared Mailbox and then terminate the user account.  (Sometimes, but not very often these days, it is exported to a […]

Get all possible AD Attributes for User or Group

20th September, 2017

I recently had to work out what the full set of attributes was that could be set against a user or a group in Active Directory.  My first thought was ok why not just grab a user in PowerShell and ask to see all properties Get-ADUser -ResultSizeLimit 1 -Filter * -Properties * However that only […]

Backup GPO Settings with retention

26th May, 2017

Backing up Active Directory should be part and parcel of creating a forest, however an often overlooked area is GPO settings.   Of course these are backed up along with AD, but restoring settings from an AD backup is pretty traumatic.  GPO settings should be backed up so that you can quickly apply an older version or […]

WPC 2016 download via PowerShell

21st July, 2016

Hi all!!! We’ve just come back from WPC in Toronto, and as first time attendees we were blown away. Not so much by the scale of it, which is impressive in itself but not dissimilar to MEC and Ignite, but the sheer quantity of information available. You can choose to do sessions, arrange formal 1:1 […]

Deleting Folders

3rd June, 2015

from an Exchange Mailbox with PowerShell I was given an escalation at a client where somehow a user managed to create thousands of folders all nested one inside the other.  So the task was how to delete these folders. User and 1/2/3rd line support had already tried using Outlook, OWA and MFCMapi but none of […]

Exchange PowerShell Quickstart – Bonus

5th December, 2014

Over the past 5 episodes we have been covering all sorts of aspects of Exchange PowerShell fundamentals.  This week I want to give just a few extra hints and tips as you step into the brave world of Exchange PowerShell. Hint 1: Don’t abbreviate Abbreviation is fine when writing directly at the command line, since […]

Exchange PowerShell Quickstart – Part 5

28th November, 2014

Over the past four parts we have covered connecting to Exchange and discovering cmdlets in part 1. We explored the pipeline in part 2 followed by hash tables, arrays and variables in part 3, and flow control in terms of conditional and iterative processing in part 4. This week we are going to cover different […]

Exchange PowerShell Quickstart – Part 4

21st November, 2014

Over the past three parts we have covered connecting to Exchange and discovering cmdlets in part 1. We explored the pipeline in part 2 followed by hash tables, arrays and variables in part 3. This week we’re covering flow control in terms of conditional and iterative processing. We covered where (?) and foreach (%) as […]

Exchange PowerShell Quickstart – Part 3

31st October, 2014

Over the past two weeks we have covered connecting to Exchange and discovering cmdlets in part 1, and we explored the pipeline in part 2. This week we will be talking about hash tables, arrays and variables. Hash Tables The easiest way to picture a hash table is a list of attributes and their respective […]

Exchange PowerShell Quickstart – Part 2

24th October, 2014

Last week in part 1 we looked at the background on PowerShell, explored terminology and some basic commands. This week we are going to see how we combine commands together on the command line via ‘the pipeline’ The Pipeline The pipeline is just a single line of PowerShell with one or more | (pipe character) […]

1