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,

Advertisements

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,

VMware Shared Raw Device Mapped Disk

Posted on Updated on

The purpose of this configuration is to decrease the time for large SQL backups in VMware virtual machines that are being backed up by VEEAM. In our scenario we have a SQL server and a File Server. We want to mount this in physical compatibility mode on the SQL server, to increase backup time by contacting the LUN on the SAN directly. Since RDM disks are independent, we want to mount the same volume in virtual compatibility mode on the FileServer so that it can be backed up by VEEAM.

For further detail on RDM, please reference the following documentation.

http://www.vmware.com/pdf/esx25_rawdevicemapping.pdf

 

1.   Configuring the SQL Server RDM in Physical Compatibility Mode

Here are the general steps to configuring RDM for physical and virtual compatibility mode.

  • Create a LUN on the backend storage device.
  • Rescan for storage devices in to confirm the LUN shows up correctly, for documentation I’m using a 15GB volume.

LUN

 

  • Once you’ve created that, go add a new hard disk. When you choose your disk type, choose “Raw Device Mappings”, and then select the LUN that was created earlier.

AvailableLUNs

 

  • Next choose a datastore that’s on the SAN that other VMs can access.
  • Select a new virtual device node that resides on a new SCSI controller. I picked SCSI (3:0). Upon doing that a new SCSI controller will be created, then finish creating the disk.

 

  • You must now change the newly created SCSI controller type to “LSI Logic SAS” and change the “SCSI Bus Sharing” to “Physical”.

SCSI

 

2.   Configuring the File Server RDM in Virtual Compatibility Mode

 

At this point, we’ve now created a LUN and created a RAW mapping to the SQL virtual machine. Now it needs mapped to the File Server virtual machine so it can be picked up by the VEEAM backup.

 

  • Edit the settings of the File Server virtual machine, and add a new hard disk.
  • When creating this new hard disk, select “Use an existing virtual disk” and point to the datastore where the RDM was mapped in the last step.
  • Choose a Virtual Device node that is on a difference SCSI controller than the other disks, I choose SCSI (3:2).

AddingVirtualDisk

 

 

  • You must now change the newly created SCSI controller type to “LSI Logic SAS” and change the “SCSI Bus Sharing” to “Physical”.

SCSI

 

At this point, we’ve now created a LUN that has been mapped RAW to a SQL Server. That SQL server can perform it’s backups to that disk which increases backup times by about 20% based in my testing. The File Server virtual machine and the SQL Server virtual machine both now have SCSI adapters that have bus sharing enabled, and thusly the disk is also mapped to the File Server. It is mapped here in virtual compatibility mode (inherent by adding an “existing virtual disk”). This means it’s persistent and can be backed up by VEEAM.

 

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

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,

Powershell Script to check if SQL is Installed

Posted on

Here we go, short but sweet. I had to come up with this today when working with a SQL Server compliance item in SCCM 2012 using a script detection method. I’ve added the else back in, but you can modify however you need.

if (Test-Path “HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL”) {
write-host “True”
} Else {
write-host “False”
}

 

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

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!

Powershell command to show names of all machines in SCOM

Posted on

Simple one-liner, very helpful though!

Import-Module OperationsManager; Get-SCOMGroup -DisplayName “All Windows Computers” | Get-SCOMClassInstance | sort DisplayName | FT DisplayName

 

This will output just the names of all machines in the “All Windows Computers” group, you can change that name to output the machine names of any other group as well.