www.jayntguru.com

March 30, 2010

windows dns server and EDns – update (added namebench info/link)

Filed under: computer geek stuff, iis, scom — Tags: — jayntguru @ 10:09 am

I have had an issue with DNS server in Windows 2003 server previously that’s covered pretty well in this article by my buddy Marcus. The short version is that EDNS is enabled by default on 2003 server, and this doesn’t play well with the rest of the internet, so it’s best to turn it off if you are using windows 2003 for external (internet) DNS.

Right now I’m working on a Windows 2008 R2 server and was having similar problems that made me check for EDNS many moons ago on 2003 server. This link came up in a search and it says that they made EDNS off in 2008 RTM, but it’s back on again in R2. He includes a link to Microsoft’s KB article about EDNS. 

Luckily this is pretty easy to turn off. All you do is run this command:

dnscmd /config /enableednsprobes 0

I wanted to update this post with a link to a cool tool I have been using. It’s called name bench and it’s a DNS benchmarking tool. Works good, does exactly what you want, and the price is right.

March 25, 2010

Obama and health care – worst president ever and one of the worse ideas ever

Filed under: annoyances, politics — Tags: — jayntguru @ 12:59 pm

In case you didn’t know, I think Obama has taken the torch from Jimmy Carter as the worst president we have ever had, for many reasons. Especially, I believe that this health care thing is a piss poor idea for many reasons, it’s too expensive (we don’t have the money – we cannot afford it), it increases the entitlement state, diminishes the concept of personal responsibility and is unconstitutional. I have posted about it many times on twitter and on facebook. I don’t want to get into a long discussion here as to why, mainly because I don’t have the time, and I feel like a lot of it has been said before, but what I did want to do was register my complaints in an open forum (the internets) so that google could pick up on them and to be sure that my feelings are.. what are those words? Oh yeah open and transparent.

I will probably come back later and update this post with some more info, but for now I wanted to put in some quotes I have run across in the past couple of days that I think are applicable.

If you’re not a liberal at 20, you have no heart, and if you’re not a conservative at 40, you have no head! – Winston Churchill

Government, even in its best state, is but a necessary evil; in its worst state, an intolerable one. – Thomas Paine

Amendment 10 – Powers of the States and People. Ratified 12/15/1791. Note The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people.

Everyone should read this.

March 23, 2010

hiding users from the welcome screen in windows

Filed under: annoyances, computer geek stuff, w7 — Tags: — jayntguru @ 9:57 am

This is a bit of an annoyance for me, but when vista or w7 boots and shows you the list of users, I personally find that annoying. Here’s a link to a fix.

March 12, 2010

keeping flash full screen when you use the mouse

Filed under: annoyances, computer geek stuff, w7 — Tags: , — jayntguru @ 2:58 pm

Since I’m a bit of a mediacenter advocate, I use the internets on the tv a lot. One of my issues with flash is that it never stays full screen if you click the mouse on another monitor. Today I ran across a how-to at lifehacker on how to fix this. It’s temporary (it will break when they upgrade versions) but it’s better than nothing.

March 10, 2010

a very cool audit utility

Filed under: computer geek stuff, iis — jayntguru @ 2:43 pm

I have been using a very cool utility for a while now that I just realized I failed to plug, it’s called Open Audit. What it does is basically is run a wmi scan on your network (it will do nmap too) and submit that data back to a mysql database through a web service. Then there’s a fancy UI that you can do searches, queries, etc.. You can get cool stuff like hardware type, see how many sticks of ram, or an IP address, or a driver, or a hotfix.

The application is written in PHP and mysql and I run the application on a windows host (it can run on just about anything) and use XAMPP, which is a pretty cool. It’s a single download that contains apache, php and mysql, all preconfigured and ready to rock and roll. All you need is some minor configuration.

While it’s pretty cool as it comes, the real power is that you can modify it all you want. So what you can do is take one of the default “views” such as list_viewdef_all_servers.php. If you open it, there’s a sql query inside that looks like this:

SELECT * FROM `system` WHERE (system_os_name LIKE ‘%Server%’)

Then you can copy/rename the page and modify that query however you like. Here’s a modification that I made so I could find servers on our internal (but shouldn’t be) net.

SELECT * FROM `system` WHERE (system_os_name LIKE ‘%Server%’) AND net_ip_address LIKE ‘192.100%’

After doing this for every custom query that I wanted, I realized that all of this data is in a mysql database. This allows you to run queries straight up, and since you used XAMPP, well you can then log in there, choose your database, find the query window, and paste your sql query right there and get the results on the spot. It’s pretty cool.

This now leads me to a gotcha I encountered today while doing my own query this way. What I had was a query that looked like this:

SELECT * FROM `system` WHERE (system_os_name LIKE ‘%Server%’) AND net_ip_address LIKE ‘192.100%’

And I was trying to find a subnet that was 10.1.13, so I made the query like this:

SELECT * FROM `system` WHERE (system_os_name LIKE ‘%Server%’) AND net_ip_address LIKE ‘10.1.13.%’

This kept returning zero results, which I knew was not the case. After looking at the data, I saw that the IP addresses were stored like this:

010.001.013.xxx

As a result I had to change my query to look like this instead:

SELECT * FROM `system` WHERE (system_os_name LIKE ‘%Server%’) AND net_ip_address LIKE ‘010.001.013.%’

wsus and cloning vm’s

Filed under: computer geek stuff, iis, scripting — jayntguru @ 11:50 am

I am currently working on WSUS (windows software update services) here at work, for the most part I’m following this excellent article at Ars. After screwing around with this for much longer than I should have, I was having issues with about half the servers not showing up in the WSUS console. Many things could have been the culprit and I checked them all.. group policy, dns, firewall rules, etc. What was the most frustrating was that I could see the clients touch the WSUS server by looking in the IIS logs, and there were no errors whatsoever, but half the servers wouldn’t show up.

Eventually I realized that it was exactly half of the servers and a light bulb went off. In our environment we have a bunch of web and app servers that are all virtual, and when we build them, we get the first node working right, and then clone and rename the vm to be the redundant node in the farm.This lead me to do some searching and I found this link. Admittedly, this is an old problem, but the first time I have run across it.

The following is a repost of the pertinent bits that have caused my trouble and are the resolution for it.

5. Imaged clients with a duplicate client ID will only appear once in the WSUS Admin Console. Each AU client must have a unique id which is created for each individual install. When imaging systems it is recommended always to use SysPrep. The WSUS admin console will only display one client for each unique ID. If you have multiple clients created from one image which are sharing the same ID, only one will appear in the WSUS admin console. All clients will check in and download updates, but only one will appear and display status in the WSUS admin console. In cases where clients are not checking in, and they were created from images without running SysPrep, the following steps will reset the existing duplicative client IDs.

a. Run regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate

b. Delete the PingID, SUSClientID and the AccountDomainSID values

c. Stop and start the Wuauserv Service

d. From the command prompt run: wuauclt /resetauthorization /detectnow

or-

From the command line, once you are sure the AU client is properly configured and not disabled, you could run a batch file (which might look something like this sample) and get the same results:

rem Fixes problem with client machines not showing up on the server due to imaging method

reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v AccountDomainSid /f

reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v PingID /f

reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f

cls

@echo Triggering detection after resetting WSUS client identity

net stop wuauserv

net start wuauserv

wuauclt /resetauthorization /detectnow

February 24, 2010

my first real powershell script – forcing sessions closed past a certain idle time

Filed under: computer geek stuff, scripting — jayntguru @ 10:49 am

I consider myself fairly decent at writing scripts for windows stuff. Mostly in batch where I would consider myself a 9/10, and in vbscript where I would consider myself a 6/10.  Of course the windows world is moving to powershell, and I have been slowly working on learning it. (It does help that my good buddy Hal is a powershell guru.) What usually happens though is I get in a hurry for something and can’t be slowed down to learn something new. Luckily since I have changed jobs, I have more time to actually learn things instead of putting out fires full time.

So anyway, until now, most of my powershell scripts were just copying and pasting various bits from others and putting them together just to make things work, but yesterday I found a bit of a challenge.

We have an application here at work that allows a limited number of user licenses, and strangely enough, it keeps a license open for a user as long as they have the windows share open. (Don’t ask me.. this is what I was told and I’m accepting it at face value.) There’s no way to expire the license if they have the share open, and it can stay open for a number of reasons. What happens is that over time we get these left open and run out of licenses. The business has agreed that anyone that’s idle more than 2 hours can be forcibly removed from the application by removing their session to the share.

We can see if these are actually in use by opening up the computer management MMC and going to shared folders\sessions. Once we sort by idle time, we can see that there are a number of sessions with more than 2 hours of idle time. (Note: In the screenshot below I have hidden the usernames and computernames.)

image

You can also see the same bit of info by running “net session” from a command prompt.

image

After some googling, I decided that wmi would be the way to go, and I immediately found the Win32_ServerConnection class. This looked like it, but if you want to see the idle time.. guess what? While everything else is, this one is not exposed. So no dice.

After scratching my head for a bit, I decided that using net session would be the way to go, and we could manipulate the output in order to get what I was after. I messed with powershell doing this for a bit and I wasn’t making any progress. Hal was on vacation in Disney world, and my other script buddy Marcus was at the Microsoft MVP summit, so I couldn’t ask him either. So I got nowhere for a bit and had to resort back to batch.

What I did was take the output of net session and use logparser.exe with a custom input format. This was a pain because the fields aren’t delimited by anything other than spaces. When I set the idle time field to date, it thought a 00:00:00 was Jan 1, 1900, so basically I was looking for a date greater than 2AM on Jan 1, 1900. Using that I was able to get the list of computers and run “net session \\%strcomputer /delete”. This worked, but it was ugly, and I’m not even going to bother posting the script, because this post is about powershell.

Yesterday I decided that I wanted to get this working in powershell as much as I can, and while searching, I ran across the Win32_ServerSession Class, and was surprised to find that it included IdleTime. Nice! (why isn’t this in with the others, Microsoft? And why couldn’t I find it by searching on their site? I ran across this on page 6 of a google search.) Of course there are no methods exposed here, so I was back to the drawing board on ending the session. Eventually I had to give up because there doesn’t seem to be an equivalent for “net” inside powershell.

Based on this, I went ahead with the script as it is now, here it is:

$strComputer = “%computername%”
$tool="net.exe"
$cmdLine = "session \\$computer /delete"
$idleuser=get-WmiObject Win32_ServerSession -computername $strComputer | where-object {$_.IdleTime -gt 7200} | where-object {$_.UserName -ne "SERVICEACCOUNT"} |  format-table ComputerName -auto
$idleuser
foreach($computer in $idleuser) {invoke-expression "$tool $cmdLine"}
write-output BIG BANG

In the end this was a pretty easy script, all I am doing besides setting up the variables is grabbing the info via wmi, then looking for IdleTime being greater than 2 hours or 7200 seconds, and then excluding the service account. Output what’s left to a table. I then print that to screen for my own sanity, and run a for loop against the computername using the command line of net session that I set up earlier.

Now it’s done, the script works, I know a bit more about powershell, and life is good. Next!

February 18, 2010

telling if tcp offload is working or not

Filed under: computer geek stuff, w7 — jayntguru @ 12:46 pm

I made an earlier post about telling if the newer advanced tcp functionality included since sp2 in 2003 server, vista, w7, 2008r2, etc was working or not. The one that I neglected to include was whether or not TCP offloading was really working or not.

All you need to do is run this command while traffic is taking place:

netstat –nt

The output will look like this:

 image

On the right hand side you can see that my connections on the example computer are in the host and not offloaded.

the vista snipping tool (where is it?)

Filed under: annoyances, computer geek stuff, w7 — jayntguru @ 12:43 pm

I went to use the vista screenshot tool just now and couldn’t find it. After some investigation I realized that the snipping tool is included with the “tablet pc components” in vista and w7. So if you uninstall things that aren’t needed (like the tablet pc components), then you won’t have this.

Why this is included with the “tablet pc components”? I have no idea. This doesn’t make any sense to me.

February 5, 2010

deleting a partition during the w7 install

Filed under: annoyances, computer geek stuff, w7 — jayntguru @ 12:22 am

I had an issue tonight when reinstalling w7 where the install would not let me delete the partitions on one of the disks… they could be formatted, etc, but the delete button was grayed out for some reason. Why it did this, I can’t tell you. What I finally found to fix it was this:

  • on the first welcome screen of the w7 install, hit shift-f10, this gives you a command prompt
  • run diskpart
  • list disks
  • select disk 0 (if this is the disk you want)
  • clean
  • exit

Then you can continue with the install on a new fresh and clean drive.

« Newer PostsOlder Posts »

Powered by WordPress