Simple PowerShell to get a Computer’s Specification

With Black Friday and Christmas fast approaching, I’m getting a lot of requests for people to help with computer upgrades or even whole new PCs.

Normally the first question you need answered is what do they have already, but this can sometimes not be straight-forward to a non-technical person.

Me: “What kind of PC do you have now?”

Them: “Sort of beigey-white? Eggshell maybe?”

We’re mid-pandemic so going round to have a look isn’t an option and my intricate multi-page documents about how to go to get each piece of info (with screenshots!) were still too technical.

So, PowerShell to the rescue.

Continue reading “Simple PowerShell to get a Computer’s Specification”

PowerShell: Checking the Syntax of an Exchange Mailbox Export Content Filter

A bit of a niche function this one.  When you perform a mailbox export in Exchange using the New-MailboxExportRequest cmdlet you can specify the ContentFilter parameter.  This allows you to pass an OPATH filter to only export SOME of the content from a mailbox.

One of the examples on the page above is;

New-MailboxExportRequest -Mailbox Tony -ContentFilter {(body -like “*company*”) -and (body -like “*profit*”) -and (Received -lt “01/01/2012”)}

So what if you need to check the syntax of a ContentFilter? Continue reading “PowerShell: Checking the Syntax of an Exchange Mailbox Export Content Filter”

PowerShell: Finding Invalid Mailboxes in Exchange

Mailboxes can me marked as invalid in Exchange;  this usually doesn’t affect the day-to-day function of the mailbox (usually) but it will prevent any changes happening to the object (using the standard Exchange tools).  However, whatever is causing those mailboxes to be marked as invalid might cause problems for other systems that use that directory (such as Office 365 or a meta-directory connected system).

To find all the mailboxes which are marked as invalid you can use the following command from an Exchange PowerShell Window;

Get-Mailbox | Where-Object {!$_.IsValid}

You can use the filter on Get-Mailbox to get a subset of data like;

Get-Mailbox -Filter {Office-Like "HQ"} | Where-Object {!$_.IsValid}

Once you’ve got a list invalid mailboxes you can remediate them

 

 

PowerShell: Tutorial 2, “Teach a Man to Fish” or Working Out The Command You Need

A series of tutorials, or How To Get Started With PowerShell:  “It’s Awesome” edition.

The title was originally built around “Teach A Man A Cmdlet and he PowerShells for a day;  Teach a Man to Use Get-Command and he PowerShell’s for a lifetime.”  But it got more and more clumsy and convoluted so I finally decided that there really was a limit to my own cleverness.

PowerShell really is quite clever though and makes it really easy to work out the cmdlets you want to use for any task. Continue reading “PowerShell: Tutorial 2, “Teach a Man to Fish” or Working Out The Command You Need”

PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing: Part 2

This is an update to my function to extract Mailbox folder permissions as PowerShell objects, allowing various forms of processing.

The main script is here.

In this update I’ve made the function skip some default folders it can’t process, treat the root of the mailbox better and improved the logging.

Continue reading “PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing: Part 2”