Disabling the Windows Server 2012 Lock Screen Timeout

by Scosby Thursday, December 13, 2012

After upgrading to Microsoft Server 2012, I was excited to take advantage of the new Modern apps offered via the Store. One of my favorite features is displaying detailed App information on my lock screen. Usually, I forget to check the outside temperature before I lock my machine to go walk to lunch. I really enjoy being able to simply glance at my lock screen to see the current temperature.

In Server 2012 by default, the lock screen will put the monitors to sleep after 1 minute. I found myself waking the monitors too frequently. An initial web search led me to a MSDN forum post for Windows 8 that unlocked the missing Power Settings feature in Server 2012.

  1.       Open the following registry key
     a.       HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7
 
  2.       Set the following value
     a.       Attributes => 2 

  3.       Now open Control Panel>Power Options>Change Plan Settings>Change Advanced Power Settings
     a.       The new Display section “Console lock display off timeout” is now available.
     b.      Configure your “Plugged in” value accordingly (0 to disable) – I haven’t tested to see if the monitor sleep setting still applies when the screen is locked.

Tags: ,

Technology | IT

Shawn Cosby Awarded Microsoft Community Contributor for 2011

by Scosby Wednesday, February 16, 2011

Today I got a suprising email from Microsoft. I was honored when I found out my contributions to the Microsoft online technical communities at MSDN have been recognized with the Microsoft Community Contributor for 2011. You can view my MSDN Profile here.

 

Tags: ,

Technology | Programming

External websites and domains - split zone woes

by Scosby Friday, February 19, 2010

This is more for my own reference, but this is a great blog post by Ace Fekay for split zone domains. A split zone domain is one where your externally hosted website has the same name as your domain (internal name).

http://tinyurl.com/y8bsfz4

Tags: , ,

Technology | IT

Hitting a web page programmatically

by Scosby Tuesday, January 19, 2010

Let's say you have a friend who is trying to win a popularity contest on a local web site. Furthermore, let's say that after you go to the site and vote you notice there is no login required and you see a bunch of crap in the query string for links as you hover over them. Let's go a step further and say you decide to write a program that will hit the website and perform the vote automatically. So, let's look at the classes in the .NET Framework that will help you do this simple example.

You will need to make a HttpWebRequest. This class allows you to work directly with a web server via HTTP and get a response back from it. To get a HttpWebResponse, we create a request and then get a response back. Quite simple, really.

Let's look at some code now.

HttpWebResponse response = null; 

try
{   
     HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(site);

     req.UserAgent = @"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)";
    

     response = (HttpWebResponse)req.GetResponse();
    

     String
message = "Http response code " + ((Int32)response.StatusCode).ToString() + " :: " + Enum.GetName(typeof(HttpStatusCode), response.StatusCode);
    

     this
.UpdateTextBox(message);
}
finally
{   
     response.Close();

}

Let's break a couple of lines down and look at them in more depth. The first line we'll look at creates our web request:

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(http://www.webserver.com/View.aspx?ID=134684&R=10);

Here, the static Create method on the HttpWebRequest class returns as an instance of the abstract base class WebRequest, so we must cast it back to a HttpWebRequest. We pass in the full URL to the Create method, this includes any query string parameters that you need.

In the next line we'll look at you'll see how we actually hit the server:

response = (HttpWebResponse)req.GetResponse();

Here, the GetResponse method on the HttpWebRequest class returns the response from the web server. Note, similar to the HttpWebRequest.Create method we need to cast the WebResponse return value to a HttpWebResponse. We can then use the StatusCode property to determine the results of our operation. I store this information in a variable named "message", which is then passed off to a contrived example method to perform further processing in this example.

The last step you should take is to release the the connection for reuse by other requests, you accomplish this by calling the HttpWebResponse.Close method.

This is a simple, abeit trivial, example of how you can work with web servers in code and help your friends win contests. This could easily be extended and plugged into a windows service, with a config file for the site and various other options...maybe even a winforms configuration application. Sounds like a good homework project to me ;)

-Scosby

Tags: , ,

Technology | Programming

Housekeeping: minor code changes for the blog

by Scosby Monday, September 28, 2009

A little bit of CSS and master page editing tonight. The darn blog title now matches the posts, not sure why a "white on white" color scheme was the default but oh well. Plenty more in the works right now, we'll see if parenthood gives me enough time to implement before the new year!

 -Scosby

Tags: ,

Technology

Hyper-V Machines taking forever to delete?

by Scosby Friday, September 25, 2009

Ben Armstrong explains the process Hyper-V goes through when you decide to delete a VM. Very informative, thanks Ben.

If you want the quick and short version: apply the very first snapshot (if any) to your VM and then delete it. Otherwise, you'll have to sit through a snapshot merge.

Ben's Blog Post

Tags: ,

Technology | IT

Spammers!

by Scosby Wednesday, September 9, 2009
New spam extensions were added to the blog tonight. Maybe a bit of extra work on it later, but it should do the trick.

Tags:

Technology

Who's your DNS daddy?

by Scosby Monday, May 11, 2009

Ok, you can skip this if you don't have a DNS server at your disposal...and everyone should have one at home, at least...but I digress.

I have been forwarding to OpenDNS for some time now, and I am completely happy. You should go get a free account and here are a few reasons why.

  • SmartCache ---- awesome stuff.
  • Parental controls --- man, I know I'm getting old when this stuff is getting more exciting. But this is really awesome and highly configurable!
  • Typo correction - personally, i've fat fingered too many .com as .cmo

If you're skeptical, it's ok. You can forward to their DNS servers free and w/o an account. Works fine that way too, but then you lose out on the smartcache and the conficker protection ;)

Happy resolving!

Tags:

Technology | IT

Virtual machine snapshots and domain connectivity

by Scosby Thursday, May 7, 2009

Often, I've reverted to an older snapshot and had a VM not connect to the domain. Here is an informative blog from Mike Kolitz. I like the netdom.exe approach, but leaving and rejoining the domain is another quick fix.

http://blogs.msdn.com/mikekol/archive/2009/03/18/does-restoring-a-snapshot-break-domain-connectivity-here-s-why.aspx

Tags:

Technology | IT

Windows Time Service on your Primary Domain Controller

by Scosby Friday, May 1, 2009

So, this isn't configured out of the box for your forest. Interesting.

You can set this up via Group Policy or the command-line. Tech-net suggests the command-line. So that's what i did. But, you can break it if you first mucked with the GPO's (like I did). But MS Support saved the day: http://support.microsoft.com/kb/969304

Do this to begin with: http://technet.microsoft.com/en-us/library/cc786897.aspx

For peers: "time.nist.gov" or "time.windows.com". I used NIST's ntp server, don't know why but i did.

 

Then from your client machines connected to the domain, they should use the PDC as an authoritative source. MS says do this: http://technet.microsoft.com/en-us/library/cc758905.aspx

I did the following on my client:

w32tm /config /syncfromflags:domhier /update


But then called w32tm /resync instead of using the "Net" command to restart the w32tm service. The /update switch on the first command should take care of that. And indeed, my client resynced with the domain controller's time clock. MAGIC!
 

I'll throw up a PowerShell script tomorrow :) or maybe Sunday...who knows.

 

FYI - gpupdate /force is a great way to immediately test your Group Policy changes, but is very dangerous if you're silly and do something stupid. So use with caution.

Tags: , , ,

Technology | IT