Windows Server

Disable Windows Firewall With PowerShell

Posted on

Welcome all, to the age of the gui-less windows server. As more and more people spin up labs with command-line only boxes, this command can be helpful.

Remember to only turn off your firewall in lab environments where you know you’re not exposing  yourself to additional risk.

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

 

To do this using netsh in cmd, you can use the following command.

 

netsh advfirewall set allprofiles state off

 

I hope this makes your day at least a little bit easier.

Thanks,

Task Manager Freezes on Windows 8/Server 2012

Posted on Updated on

I’m the kind of guy that ALWAYS has task manager open. I’m serious, ask anyone I work with — I sometimes even have a whole screen for Task Manager and Resource Monitor (Maybe that’s why I like SCOM so much?). Though, I’ve noticed a couple of times on Windows 8, Windows 8.1, Server 2012, Server 2012 R2 that when I open task manager the stats just freeze. The system is fine, everything is normal but the stats just freeze — like this.

frozen.PNG

 

They never do anything else, and just stay at that initial opening mark. So frustrating! I’ve SFC’d, I’ve rebuilt my performance library, I’ve copied new bits for taskmgr.exe, everything! It turns out for some reason sometimes the view speed gets set to pause. I never would have though of that, but somehow it just happens (though, I’ve never seen it happen in any OS earlier than Windows 8/Server 2012).

 

Here’s how you fix it. Go into View –> Update speed and notice it’s set to pause. So strange.

paused.PNG

 

Go ahead and set it to normal and you’re back in business!

normal.PNG

 

I hope I’ve made your day, at least a little bit easier.

 

Thanks,

How to find the Hyper-V host name of a guest VM

Posted on Updated on

In all of our environments we all know EXACTLY what’s going on, where it’s going on, and where everything is right? Chances are that’s not true, and like most of us, especially in large home-grown development environments there are servers sitting under peoples desks, in some random closets, etc. Here’s an easy way to find out on what Hyper-V host a guest resides.

(get-item “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).GetValue(“HostName”)

 

Pop that into powershell and you’re good to go!

 

Hope I’ve made your day at least a little bit easiser.

 

Thanks,

SCCM 2012: WSUS Server version 2.0 SP2 or above is not installed or can not be contacted

Posted on

This week I had an issue where I needed to rebuild the WSUS server leveraged by my SCCM 2012 Software Update Point. After uninstalling/reinstalling WSUS from server roles, I downloaded and installed SP2 for WSUS 3.0 since that’s the requirement for SCCM 2012. At this point the normal train of thought would be “I met the requirements, all should be well!”. No. That’s not the case.

SMS_WSUS_CONFIGURATION_MANAGER status query was showing tons of errors including that of “WSUS Server version 2.0 SP2 or above is not installed or can not be contacted”, so were the other WSUS related status queries. Dig, dig, dig! This is the point where the logs come in handy.

Pop open WCM.log in CMTrace and the verbosity is a life saver!

wsus

 

You will notice that, just like with all other SCCM components if there is an issue it will try again every 60 minutes. In this case every 60 minutes it was the same 8 log entries. “Supported WSUS version not found”, but wait — one of the log entries tells you exactly what it’s looking for (wouldn’t that have been nice to know as a prereq?). WSUS 3.0 SP2 + KB2720211 + KB2734608. After these two KB hotfixes are installed, restart the SMS_WSUS_CONFIGURATION_MANAGER (or restart the machine) component and VOILA! Everything starts configuring and processing correctly. I’ll include a link to the two hotfixes below. Happy updating!

 

KB2720211 x64: http://www.microsoft.com/en-us/download/details.aspx?id=29999

KB2734608 x64: http://www.microsoft.com/en-us/download/details.aspx?id=30747

 

I hope I’ve made your day, at least a little bit easier.

Thanks!

Server 2012 R2 “does not have a network adapter available to create a virtual switch” when configuring VDI

Posted on

I recently ran into this issue when doing an all-in-one VDI install, on top of a server that had been used for other things in the past. The “quick start” VDI option is supposed to essentially do everything for you, but I ran into this issue.

“The Server does not have a network adapter available to create a virtual switch”

fail1

 

Taking a quick look here, I do have a vSwitch. Why is it complaining?

vSwitches

 

 

It turns out that the installer isn’t actually complaining about the fact that there is no vSwitch, it’s complaining that there IS a vSwitch. It needs it to be a “blank slate” so it can manage it and do it’s thing. I’m not a fan of this, because I intend to manage my VDI environment using SCVMM, and the VDI component itself won’t have a whole lot to say about it. Nevertheless, this is how you get past this. Delete any vSwitches.

 

no-vSwitch

 

 

All gone, now try the installer again.

 

done

 

 

There we go, now we’re off onto the next step without any errors. Have fun!

 

I hope I’ve made your day, at least a little bit easier.

Thanks!

Powershell Script to Test SMTP

Posted on

This one is going to be short and sweet, I’ve been testing SMTP with and without encryption and wanted a good script for that.

Here are the lines that you’ll want to look at configuring:

  • Line 5: “$smtpServer =”InsertYourSmtpServerHere”
  • Line 12: Change the $false value to $true if you want to encrypt your SMTP with SSL
  • Line 13: If you’re using a non-default SMTP port, change the “25” to whatever you’re using
  • Line 15: Only change this if you need to enter credentials for authentication
  • Line 18/19: Change these to who you want to say the email is from, and to whom it is being delivered.
  • Line 21: Change this to whatever you want your email title to be
  • Line 25: Change this to say whatever you want the body of the email to say

 

There are also some write-host’s in there to let you know the values that are being run and whether or not they were successful, which will print to the powershell console.

https://gallery.technet.microsoft.com/Powershell-SMTP-Test-Tool-621b07ae