DHCP Option Values and PowerShell

Following on from my previous post, i wanted to share a small bit of PowerShell i created whilst on a site visit.

This was before i had worked on Vendor Classes but actually follows on quite nicely. In the previous post i mentioned a requirement to set an alternate NTP Server address, and used 1.uk.pool.ntp.org.

For those who may have worked with those NTP Servers in the past you may know that (as the name suggests) they are a pool of servers and the IP address returned changes frequently. So, setting that value statically and forgetting about it led me to find a new Phone on a clients desk was not syncing the time.  Read more of this post

Install Windows Server Essentials with a Custom Domain Suffix

After a brief argument with Susan Bradley, and i use the term brief and argument loosely, Grey Lancaster and i were left with a problem…

So can someone blog that/post that on TechNet so that folks aren’t hacking up what they are doing now?

Grey, of course, deferred to me. So here i am Saturday night and I’m writing this. I don’t mind of course because i have nothing better to do, but i digress.

Yes, you can install Essentials 2012 R2 (and probably other versions) with any domain suffix, not just the “.local” that the Essentials Configuration Wizard (ECW) will default to..

Read more of this post

Windows Server Essentials – Configuration Troubleshooter

powershell2xa4I had a support case this week where it became apparent to me that there is no quick and easy way to test Essentials Servers for Configuration errors. Manually working through IIS or Certificates is prone to human error, as was proved to me, by me missing certain key things.

Uncharacteristically i decided to write a PowerShell script to save me from this sort of embarrassment in the future, and make me look really good next time i need to troubleshoot an Essentials Server.

You can download the tool from here, and am very interested to hear how it works for you.

If you have already downloaded it, i have updated the tool so you should download it again!

Read more of this post

PowerShell, Make it do something useful!

powershell2xa4$users = ((Get-ADUser -filter * | where-object { $_.GivenName -ne $null }) | foreach{ $_.Name})
foreach ($user in $users)
{
        $FirstName = (Get-ADUser -filter {Name -eq $User} | foreach {$_.GivenName}).ToString()
        $SurName = (Get-ADUser -filter {Name -eq $User} | foreach {$_.SurName}).ToString()
        $DisplayName = ("$Firstname" + " " + "$Surname")
        $DisplayName
        Set-ADUser $User -DisplayName $DisplayName
        Set-ADUser $User -Description "User Created by Windows Server 2012 Essentials Dashboard"
}

You might be wondering what the hell that means?

Read more of this post

SBS 2011 Standard: Add a PSConfig Email Alert

sbsstdA client called me today to say ‘we cant get on the internet’, I asked what happened when they loaded up the browser, and they got a 503 Service Unavailable.

Read more of this post

SBS 2011 Essentials : PowerShell Cmdlets

sbse-conPowerShell is pretty cool. There does not seem to be much you can’t find out with it, or configure with it.

Not being a developer i struggle to build complex PowerShell scripts

Read more of this post

Quick Fix : Did I Update or Did I Not Update, that is the question!

powershell2xa4I currently have a number of books on my desk that i use for reference, you may have heard of them, read them, bought them, stolen them, sorry, borrowed them etc, Anyway they wont be a new idea to you, i don’t mean books in general i mean these particular books. I am of course referring to the Administrators Pocket Consultant series from Microsoft Press.

All of them unnervingly seem to be written by the same person, Mr William R Stanek. Anyway there is a point to this.

I have been answering questions in the forum recently and i find myself asking the OP, hey do you have XYZ update installed?

They usually reply, how do i check?

Of course i refer them to their Administration journal, which clearly shows the date and time any update had passed testing and was approved for installation, the name of the tech who logged onto the server, the colour of his socks he had on whilst he installed it. Of course it could have been a her.

Knowing many of you don’t keep such a journal only saddens me, i like to know what colour socks i had on, on a given day and i frequently go back and check.

I turned of course to my PowerShell Administrators Companion, and found the following command.

Never again shall you be left red faced by the question, do you have XYZ update installed? Not only will you be able to answer with confidence, you will be able to give all sorts of other detail that will really impress me.

Loading up PowerShell, you can simply type…

Get-Hotfix

get-hotfix

This will list all of the Updates, Hotfixes and Service Packs that have been installed onto the system, it will also list the date, and who installed them.

But how does that help you find a specific update? Simply add the KB number you are looking for.

Get-Hotfix –id <KB Number>

For example if i want to know if i have installed SBS Essentials Update Rollup 1, i can type..

Get-Hotfix –id KB2554629

get-hotfix-ur1

If the hotfix is not installed you will get an error.

get-hotfix-err

As easy as that.

By the way, I’m not selling these books nor do i earn commission out of their sale, but i have one of these books for pretty much every Microsoft Server/Client OS i support. They are cheap and are just full of brilliant tips such like the one i just ripped off and turned into a blog post.

%d bloggers like this: