WSUS: Reset Server Node While Browsing Computers

I’ve run into another very annoying WSUS bug and this one deals with Computer Model information being corrupted when being entered into the SUS DB.

wsus_groups.png
Crashing groups highlighted in red.

Twice I’ve encountered a bug where the WSUS console would crash every time I tried to browse the All Computers or Unassigned Computers groups, but it wouldn’t crash when I browse another sub-group.

I found a very useful blog post that showed how to fix it but I’m unable to find it now; however, I was able to remember the steps I took.

  1. Using SSMS, export the table tbComputerTargetDetail to a csv. (Select * query, then save the results as csv.)
  2. Sort the various columns to find the one with the box (like an unknown character). This is the corrupt entry. For me, its always been the ComputerModel field.

    wsus_corrupt_example.png
    A similar example.
  3. Note the TargetID #.
  4. You can use the TargetID number in the tbComputerTarget table to find out the hostname of the offending machine for a permanent fix.*
    SELECT FullDomainName
    FROM [SUSDB].[dbo].[tbComputerTarget]
    WHERE TargetID = '<targetid#>'
  5. Blank out this field.
    UPDATE [SUSDB].[dbo].[tbComputerTargetDetail]
    SET ComputerModel=''
    FROM [SUSDB].[dbo].[tbComputerTargetDetail]
    WHERE TargetID='<targetid#>'

WSUS will be working again.

*To fix this issue on my client machines, I’ve only needed to update the offending machine’s BIOS.

Advertisements

WSUS Doesn’t Download Updates

While rebuilding WSUS (once again) I discovered another snag. When first configuring WSUS I put in “D:” for the drive to store the updates because the wizard didn’t like “D:\”. Unfortunately, both are wrong. From what I read in various posts, the wizard used to default to the largest drive with free space and append \WSUS for a directory. If you just specify “D:”, the updates try to download to D:WsusContent and not D:\WsusContent. (The eventlog shows this.)

A comment on this blog post helped fix it without a reinstall:

wsusutil movecontent D:\WsusContent D:\WsusContent\movelog2.log -skipcopy

After a reboot (and waiting, as WSUS isn’t very speedy) , the updates started downloading.

For future installs: don’t specify the just the root of a drive, specify a subdirectory like “D:\WSUS”.

PS: here’s what the log file says:

2017-04-07T21:04:23 Successfully stopped WsusService.
2017-04-07T21:04:23 Beginning content file location change to D:\WsusContent
2017-04-07T21:04:23 Did not copy files due to -skipcopy flag.
2017-04-07T21:04:23 Successfully changed WUS configuration.
2017-04-07T21:04:24 Successfully changed IIS virtual directory path.
2017-04-07T21:04:24 Successfully removed existing local content network shares.
2017-04-07T21:04:24 Successfully created local content network shares.
2017-04-07T21:04:24 Successfully changed registry value for content store directory.
2017-04-07T21:04:24 Successfully changed content file location.
2017-04-07T21:04:25 Successfully started WsusService.
2017-04-07T21:04:25 Content integrity check and repair...
2017-04-07T21:04:25 Initiated content integrity check and repair.

DFS-R MaxOfflineTimeInDays

I had a screwy server that wouldn’t replicate a folder in DFSR because it had past the 60 day limit. I’m not sure why this server was out of date for so long.

EventID: 4012

The DFS Replication service stopped replication on the folder with the following local path: <folder>. This server has been disconnected from other partners for 152 days, which is longer than the time allowed by the MaxOfflineTimeInDays parameter (60). DFS Replication considers the data in this folder to be stale, and this server will not replicate the folder until this error is corrected.

To resume replication of this folder, use the DFS Management snap-in to remove this server from the replication group, and then add it back to the group. This causes the server to perform an initial synchronization task, which replaces the stale data with fresh data from other members of the replication group.

Additional Information:
Error: 9061 (The replicated folder has been offline for too long.)
Replicated Folder Name: <folder>
Replicated Folder ID: A484AB0F-7DAE-4A43-BFC4-59303224FD23
Replication Group Name: domain\dfsroot\foldername
Replication Group ID: 201BA6C5-92C9-4FDF-BE2B-C9FDC6869FBD
Member ID: 9B24A868-4C07-4BBE-AE09-C0D9427C9A24

Following the suggestion in the EventID, I removed the folder completely from DFS Replication and Namespace and let everything sync back up. The event log even said that the Replication member was dropped. However, when I re-added the folder I received the same error message again.

So I changed the MaxOfflineTimeInDays option to 155 days with this command and restarted the DFSR service:

wmic.exe /namespace:\\root\microsoftdfs path DfsrMachineConfig set MaxOfflineTimeInDays=155
net stop dfsr && net start dfsr

The event log showed that DFS-R started replicating the folder again and everything is back to normal again. Then I changed the MaxOfflineTimeInDays option back to it’s normal 60 days.

Surface Ergonomic Keyboard

SurfaceKB.jpgI broke down and bought a Surface Ergonomic Keyboard the other day and I’m quite pleased.

Features

The media keys work! No need for remapping. That was a not-so-minor annoyance with using the Apple Keyboard on Windows: several missing keys, no media keys, and the need to remap something if you really wanted it. It wasn’t a deal breaker for me because I like the feel of the keyboard and it’s very easy to type on, but it’s nice to have media keys back.

The only issue with having media keys is now I have to toggle for Function keys. I do use F2 (rename) and F5 (refresh). But there is a toggle switch so you can choose which keys will be the default.

There are media keys for mute, vol up, vol down, prev, play/pause, next, bright up, bright down, magnifier, multitask, connect to devices, settings, calculator, minimize all, notifications, and lock.

Bluetooth is built in so there is no dongle. The keyboard runs off of two AAA batteries. Pairing it up with Windows 10 was a breeze.

The ergonomic keyboard has a bit more heft to it than the regular keyboard. It’s a good weight. I prefer keyboards have a bit of mass to them. I don’t want it moving around on my desk.

Aesthetics

The keyboard looks great. It’s all various shades of grey. The palm rest for the ergonomic keyboard has a nice feel to it. MS says it’s easy to clean but I’m just leery about a cloth palm rest. It’s some fancy Italian fabric. Soft, and padded a bit. The cloth palm rest is the only thing I’m leery about with this keyboard.

SurfaceKB2.jpg

Nitpicks

  • The lights to indicate the capslock, num lock, etc. are a little dim or small.
  • The shift key next to the Z is a bit small too. Altho’ it could be that I’ve not used an ergonomic keyboard in a long time.
  • A bit spendy at $130, but if it holds up as well as a mechanical keyboard then it’s worth it.

None of these are deal breakers.

Conclusion

I’m still testing out the ergonomic version. I’m tempted to go back and get the regular version, since I use a regular mechanical keyboard at work.

I heartily recommend this keyboard. What little time I’ve spent with it I can say it’s a great keyboard. It’s a little spendy, but if you like the Apple keyboard style with perfect Windows (Win8, 8.1, 10. No Win7) integration, this keyboard is great.

Microsoft Surface Keyboard

For the longest time, my favorite keyboard was the Apple keyboard. I loved the chiclet keys, the low profile, the Apple aesthetics. However, I was always missing the 100% Windows integration. I became used to using the Option key for the Windows key, the missing print screen, and a few others caveats; eventually, I worked around them. But I always maintained that if someone could make and Apple keyboard with Windows keys, it’d be the best Windows keyboard ever.

I think Microsoft finally did it with the Surface Keyboard.

SurfaceKeyboardPdp_1_HeroPDPPanel_1_2_V1.jpg

SurfaceKeyboardPdp_1_HeroPDPPanel_1_3_V1.jpg

At $99, it’s a little spendy for a non-mechanical, wireless keyboard, so I’ll have to sit on it for a bit, but so far it seems to be the keyboard I’ve been searching for.

Migrating DHCP Reservations

I had to migrate dhcp servers and the export/restore wasn’t working for me. I read that the export/restore method only works on the same server. I’m migrating from 2008 to 2012R2. However, there is a command-line method to add DHCP reservations in Windows and there is an easy way to get a list of existing reservations:

netsh dhcp server dump > output.txt

I could only get this command to run on the local server. Running it remotely didn’t seem to get all the output, but at least it gave me the reservations and I didn’t have to retype them. (Run these commands from an elevated command prompt.)

dhcp Server \\dhcpserver.domain.com Scope 192.168.1.0 Add reservedip 192.168.1.10 0123456789ab "host.domain.com" "" "DHCP"

Kudo to this blog post for the tips.

Find the DHCP Server

I had to find the dhcp server, but I can’t find any good method in Powershell. So I’m using Powershell to parse ipconfig /all.

$a = [string](ipconfig /all | findstr /C:"DHCP Server")
if ($a.Length -gt 0) {
$dhcpserver = $a.Substring($a.IndexOf("1"))
}

Which will take:

DHCP Server . . . . . . . . . . . : 10.10.4.2

And give you:

10.10.4.2

.NET 4.0 and InstallUtil.exe

I have a Windows 2003 (x86) server complaining that InstallUtil.exe from .NET 4.0 was not a valid win32 application. Repairing .NET 4.0 did not help. Reinstalling .NET 4.0 kept causing the x64 version of the file to be installed, not the x86 version. The x64 version is about 40KB. The x86 version is about 28KB. Replacing the file from a working machine fixed the issue.