Experts Live 2015 – tickets tickets tickets!

Step right up, step right up….

A quick post on behalf of my colleague, 365Dude, who’s presenting a session at this year’s Experts Live 2015.

He still has 3 tickets available in case someone is interested in going to this year’s convention, November 19th.
Be sure to drop him an e-mail if you’re interested in going!

And even if you’re not interested in an Office 365 session, have a look at the program to see what might else be of your interest!


Lab: Connect to your ServerCore using remoting – step by step

The next part in my Lab setup now that I’ve gotten network configured is to actually no longer touch my new Lab machine…

While that might sound strange at first, the reason for this is simple.
My Lab should be a headless server, stuffed in a cabinet somewhere with power and a network connection and I should be able to do ALL my management tasks remotely.

This should be a simple task you’d say, but for the sake of clarity [and to learn this process better myself] I have decided to write down all the steps required to do this.

What is the goal and what is required

I think it helps to first define your goals before you start tinkering with a solution, as you might be easily distracted and not reach the goal you had set for yourself.
According to your goals, you note down what steps are required to reach those goals.
Don’t get me wrong, not the immediate script, just the simple text version of what you think you need to do to achieve the goal.

This is especially helpful for me, as I tend to get distracted a LOT!
Think Hammy from Over the Hedge or Dug from UP!

My goal in this case are as follows:

  • Connect to ServerCore using the computername through PSRemoting.

What is required:

  • Add the ServerCore’s computer name to my client’s hosts file
  • Add the ServerCore’s computername to my client’s Trusted Clients settings under WSMAN
  • Connect to ServerCore WSMAN
  • Add the client’s IP address to the ServerCore’s Trusted Clients settings under WSMAN

The code

Client machine Hosts file

Please note: these steps require PowerShell to be run as Administrator.

First of all we want to define some variable which we want to use later on

Of course we want to automate the addition of the ServerCore’s computername to the local hosts file, but in case we’ve already done this, we need to build in a check

To explain: I’m reading the contents of the current Hosts file, located here:  C:\Windows\System32\drivers\etc\hosts .
Just in case you’ve installed Windows in another folder, the script automatically gets the correct location.
It will then check if the Hosts file already contains a line with the ServerCore’s IP address and Name.
If this is not there, it will automatically add this line to the $Hosts variable.
Once this is done it will write the contents of this variable back to the actual file and force it.

Client machine Trusted Hosts

Please note: these steps require PowerShell to be run as Administrator.

Now that you’ve changed the Hosts file, we need to add the ServerCore machine to our WSMAN Trusted Clients.

This will first read out the currently configured Trusted Hosts on your client machine and will then add the ServerCore to this list.
In case you DON’T have any Trusted Hosts configured on your client machine yet it will only add the ServerCore machine.

To check that everything is configured properly [or to check if you have any Trusted Hosts configured on your machine], you can run the following command:

Connect to ServerCore WSMAN

Please note: these steps require PowerShell to be run as Administrator.

While PSRemoting is enabled on Windows Server 2012 R2, it isn’t configured to allow connections from your Client machine.
WSMAN on the other hand is 🙂 .

We can simply create a connection to the machine by using the following commands:

ServerCore machine Trusted Hosts

Please note: these steps require PowerShell to be run as Administrator.

Now comes the tricky part:
We want to automatically get our Client machine’s IP Address and add this to the ServerCore’s Trusted Hosts list.

First we get our Client’s IP Address [requires PowerShell v4 and Windows 8+]:

Now that we have the Client machine’s IP Address, we can add this to the ServerCore’s Trusted Hosts:

Once again we want to check if everything’s properly configured:

The result

Once this is done, you should be able to do the following

Tada!! 🙂



Reasons to blog


As I’m pondering what to write for my first proper techy blog post, I’ve got to thinking about WHY I’ve chosen to blog in the first place.

Learning by doing…

I’m generally a lurker on forums and social media.

Whenever I need something, I go to Google and have a field day trying to find out of someone has had the same issue that I’m experiencing and hopefully someone has solved it for them.

While this is perfectly fine, over the last few months I’ve noticed that participating in the whole “social” world makes you think about PowerShell more, makes you actively work with PowerShell more and basically it gets you more involved, learning by doing.

It might give you perspectives that you’ve never thought about before [there’s multiple ways to Rome..] and just lets you think about issues you might never think about/come across in your normal day of work.

So for me, blogging makes me have to actively think about PowerShell and DO something with it.

Growing by teaching…

Another point for me to start blogging has to do with my lurking again.

I’m on Twitter, but I never used to be actively participating in it… I just read articles tweeted or retweeted by people I followed, but never posted anything.

Until I read the following article by David Sanoy: Be a PowerShell Champion.

I won’t copy the entire contents, but to sum it up:

You don’t need to be the best in PowerShell, but by sharing, teaching, promoting and helping people, you yourself can be a “Champion” of PowerShell within your company/community.

Based on this, with the help of some of my colleagues we started having active tech sessions at work and I gave a presentation on “What is PowerShell” and basically trying to introduce my co-workers to the magic that is.

The amount of people showing up, the reviews, the “high” and all was unexpected to me and really gave me a kick….

I liked teaching people, I liked getting people enthusiastic about something.

Another added bonus was that while preparing for the presentation, I noticed that I had to really KNOW what I was telling them.

Through blogging I’d like to get the same experience, but with a wider audience!