VM Lab – Introduction

Hey guys,

It’s been a bit quiet lately, some holiday time and most importantly a change of jobs!
As of July 1st I now work for OSC as an Infrastructure Specialist and will hopefully have more time to expand my knowledge and share this with the community.

The last few weeks I’ve been busy playing around with a solution in order to quickly create a Lab with VM’s.

While I know how to manually set them up and create machines, I had a somewhat ‘ideal’ method in mind and didn’t really want to stray from that idea.

I will finish up the solution this week hopefully, but already have a Proof Of Concept [POC] solution working as intended.
While this sounds all fancy, basically I have all the tiny building blocks ready as scripts.
It means I will need to finish writing all the help files, modifying them from scripts to functions and putting them all in a single module.

What does the solution do?

Here’s a quick overview of what my solution does:

  • Create [or checks if it exists] a default Hyper-V folder structure in place where you can store everything you require for your Lab
  • Create a default Hyper-V infrastructure in place which you can utilize for your Lab
  • Creates template VHD files on which you can base your Lab VM’s.
    This solution provides templates for the following Operating Systems:

    • Windows 8.1
    • Windows 10
    • Windows Server 2008R2 [Core + GUI]
    • Windows Server 2012R2 [Core + GUI]
    • Windows Server 2016 TP5 [Core + GUI]
  • Creates differencing disks based on the above template VHDs, which are ‘enhanced’ by custom Unattend.xml files specifying:
    • ComputerName
    • UserName
    • Password
    • Organization
    • IP Address
    • DNS Server Address
    • Gateway Address

Once you have the template VHD files created [this takes the longest and only needs to be done once], it takes SECONDS to configure and start up your custom Lab VM


What next?

As mentioned above, I will need to update the help files, fine tune certain bits and convert the solution from separate scripts to functions in a module.
Now I’m not expecting this to take ages, but I want to make sure I don’t accidentally break my current solution.

In the coming time I will try and break down all created functions and provide the entire code.

To be continued! 🙂


Knowledge is power..

I’ve recently had some discussions with my colleagues about certifications, experience, knowledge etc. and was asked to share information on how I got to where I am today and what I use to keep furthering up.

While I had given those colleagues a direct answer and had thought about writing an email to several of them with some basic information, I thought sharing this information with a larger audience would be handy…. That way I can simply update the information and point to my site if there’s a change.

So without further ado..

While always being keen on learning, I was particularly triggered by 2 quotes made by Don Jones [Pluralsight and PowerShell guru] which I think are essential mindsets that should help you progress:

If you’re not willing to invest in your career, why should anyone else?


Your career is your career, not your company’s. You should be focusing on the technologies and techniques that you know are important to the industry, whether your company needs you to, wants you to, or pays for you to or not

I could easily copy more quotes from him that I find interesting, but instead I’ll just refer to 2 posts made on his site which I would highly recommend reading:




Less talk, more do..

Besides just theory and articles, here are some resources which I recommend using when trying to further your career [focused on Microsoft curriculum].
Also know that furthering your career means certifications, theory and experience… so don’t just focus on one and not the other.


  • Microsoft Virtual Academy
    Microsoft’s counterpart to Pluralsight, only this one is free, but restricted to purely Microsoft products
  • Microsoft TechNet Virtual Labs
    In case you need some hands-on access to a lab for a specific subject.
  • Microsoft Channel 9
    More access to video training, seminars and other activities such as Build, Summits etc.
  • Pluralsight
    Awesome access to video training.
    Not free [except for trial period], but personally I think worth every penny.
  • Microsoft Press Store
    Official Microsoft books which can be handy for your certifications.
    Be aware on the lookout for offers which can easily provide up to 40% discount.
  • Manning
    Awesome technical books to expand your knowledge.
    While these don’t usually focus on certifications, they tend to have a lot of actual real-world subjects.
    Not to mention their MEAP [Manning Early Access Program], which allows for access to books while they are still being written and the fact that buying a physical book automatically gives you access to the e-book version [why don’t other publishers do this…].
  • Test exams for Microsoft can be done through either of the following companies:
    Measure-Up , Transcender of Kaplan Selftest.

Personal experience

Try and find user groups relating your field of interest near to you.
Networking can really help you get in touch with like minded people and this will further your chain of knowledge at lightning speeds].
For The Netherlands here are some resources to known User Groups [UG’s]:

  • DuPSUG
    Dutch PowerShell User Group
  • WMUG
    Windows Management User Group in The Netherlands [also SCCM UG]
    NL VMWare User Group

Besides User Groups, you also have Facebook Groups and of course Twitter feeds.
On my New to PowerShell post you can find some PowerShell related Twitter feeds that might be interesting.


All in all

Be willing to spend time to grow..
While I’m sure some people will tell me I’ll never grow any further, I’m sure they meant my physical stature… right @365Dude? 😉

Don’t let others keep you down, but it takes effort even stay afloat in IT.
If you’re the lazy type or don’t like learning, learn efficiently.

If that still doesn’t do it for you, IT might not be the branch for you.
In which case, don’t be surprised if you get automated in the near future 🙂



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 Shell

First 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:

Blank result told me that if it was going to be Rules, it would have to be Client Side Rules…. great…

I had informed the customer of this and it would be up to them to have the users check their Client Side Rules [if needed disable them temporarily] in order to find the culprit.
The customer took it one step further and went past all the users’ desks [luckily ‘only’ around 30’ish people] and checked the Rules himself, but unfortunately nothing.

Back to the drawing board

First of all I confirmed the 2 next issues:

  1. The mailbox is actually a proper Shared Mailbox and not a Resource Mailbox by mistake
  2. What happens to e-mail directly sent to the mailbox?
    Well, I had sent 2 test emails to the mailbox and left them in the Inbox for 2 days to see if perhaps someone’s Client Side Rules would get triggered..
    [Un]Fortunately these mails were not moved/removed, so something else must be causing this…

Knowing these bits, I needed to drill down to the specific mailbox and find out exactly what was happening there.

The magic word is….

But of course, if you audit folders etc. , why can’t you audit mailboxes?

It turns out, you can, and quite detailed as well!

Using my best friend Google, I looked up the details on what to use and how to use it.
Yes, I know, perhaps I should’ve used the built in

but I personally prefer to use Google to point me in the right direction and then let the built-in Help function show me how to customize the usage of said command.

This TechNet article told me everything I needed, the command I required was as simple as ever

But what is audited by default? What are the default settings for the auditing?

This shows me the following:

  • AuditingEnabled
    Well, this should be rather clear 🙂
    Default value = False
  • AuditLogAgeLimit
    How long should the Audit Log live before it’s recycled?
    As the Audit Log is contained within the actual mailbox, you want to limit this, as it takes up space depending on how much you want to have audited
    Default value = 90 days
  • AuditAdmin
    Which actions performed by Administrators should be logged?
    Default value = Update, Move, MoveToDeletedItems, SoftDelete, HardDelete, FolderBind, SendAs, SendOnBehalf, Create
  • AuditDelegate
    Which actions performed by a Delegate should be logged?
    Default value = Update, SoftDelete, HardDelete, SendAs, Create
  • AuditOwner
    Which actions performed by the Mailbox owner should be logged?
    Default value = nothing

Great, but I would prefer if I saw a little more details for Delegates to I can report this back to the customer.
This TechNet article explains exactly what action means what, so you can easily tell if it’s interesting for your auditing or not.

Ok, so this is what I set up to configure both auditing and the actions I wanted audited

Testing your code

Ok, I’ve added auditing, now what?

I need to be able to check my audit logs and see if specific actions get reported the way I want them to.
What I did was as follows:

  1. I created a subfolder under Inbox called Test
  2. I moved my first test message to the newly created folder
  3. I copied my second test message to the newly created folder
  4. I removed my original second test message

Great, these are basically the actions I need to have checked.

I can now search the logs using this command:

Because the output can be a bit much to sift through, I save the details to a variable first

and I’ll sift through the values to see what I would like to have reported back to me.

Now to be honest, while running through this I had also found this GREAT article by Paul Cunningham, an Exchange Server MVP which basically had all my wishes pre-made.
While I love playing around with PowerShell to find the perfect solution, I have to take into account that the customer is experiencing an issue that needs addressing, so I used Paul’s script to get the report I wanted.

Automate the reporting

Now I have auditing configured and reporting on my audit, I have to make sure I get this report on a regular basis so I can track the culprit down.

Since this customer has a Windows 2008R2 Server running, setting up Scheduled Tasks with PowerShell was not yet properly implemented, so for this time I’ll manually add the Scheduled Task following the steps in my Scheduled Tasks – PowerShell Scripts with Parameters post [conveniently posted BEFORE this article 😉 ] and run it once to confirm that it runs as it should and doesn’t produce errors.

The trap is set, now we wait!

As this is an actual issue I’m experiencing right now, I’ll let you know the results when I know them, but you can already use the above techniques for your own troubleshooting.


Happy scripting!