/images/ducttape.png

Going on a Get-Date…part 1

Simple issues, simple solutions?Recently I’ve been doing quite some break-fix cases, which didn’t quite make blogging a high priority. It did on occasion provide me with nice little gems that I decided to spend a little personal time on, because I thought it would be better to force myself to use PowerShell instead of resolving things manually or through a GUI. Also, I thought these issues would be “simple, quick solutions”, which turned out to be a bit too optimistic.

The case of the disappearing e-mail…

One of my customers was running into an odd case of disappearing e-mails. They have an on-premise Exchange 2010 mail server on which they have a Shared mailbox to which all employees have access. Now all of a sudden mails that are moved/copied TO this shared mailbox mysteriously disappear… First thing that came to mind: Rules! Bring in the ShellFirst of all I needed to check if there weren’t any Server side rules which were configured, which you can easily do with the following command:

Scheduled Tasks - PowerShell Scripts with Parameters

Perhaps a very “simple” issue, but I noticed that when looking for this it took me longer than expected to find the result I had in mind. The issue at handI have a script which requires various parameters to be provided so that I can run it. When running the command through an active console session it would look like this: 1 .\Get-MailboxAuditLoggingReport.ps1 -Mailbox ProblemMailbox -Hours 24 -SendEmail -MailFrom administrator@contoso.com -MailTo administrator@contoso.

Migrating scheduled tasks from 2008 to 2012+

Today I was busy with a customer who needed to migrate some Scheduled Tasks from his Windows Server 2008 to his new Windows Server 2012 R2 machine. Slight issue, there were 139!! Scheduled Tasks [generating reports and sending them to various sources]. There’s no way I was going to do this manually, so let’s start up my favourite tool for the job: PowerShell! I immediately ran into the first issue: There are no PowerShell cmdlets for Windows 2008 concerning Scheduled Tasks, so you’re limited to the built in command SchTasks, however this can be a troublesome parsing etc.

Script Dumpster: Clean-RedirectedRecycleBin

The problemRedirected Folders on RDS Session hosts tend to cause a specific issue: Each user’s set of Redirected Folders creates their own Recycle Bin entry, which can grow quite a bit. The following function can display a list of files contained within the Recycle Bins older than the provided age. Even better, the script has a switch parameter Remove which does exactly what you think it does 🙂 Through a scheduled task you can run this script on a regular basis when required.

Script Dumpster: Find services running under non-standard accounts

The ProblemLooking for services which are running under NON-standard accounts? Just use this script to display these services. Very handy in case you need to change passwords for service accounts or want to see what services might be improperly configured [e.g. running under Administrator credentials, or worse, Domain Administrator credentials] The Script 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 <# .