Force Windows Update check from command line

windows-8-logo-png-819
Here are a few commands for running the Windows Update Agent from a command line:

Force detection of updates:
wuauclt /detectnow

Force reporting status to an Windows Update Server:
wuauclt /r /ReportNow

Stop and start the automatic updates service:
net stop wuauserv
net start wuauserv

To help troubleshooting here’s where the log is normally.
%systemroot%\WindowsUpdate.log

Some more documentation on Microsoft’s Technet site.

SQL Server Reporting Services IIF statement Error

I have a column in a report that calculates a variance between two other columns and displays a percentage.
Some of the columns end up with a zero which would result in a divide by zero error.

So I wrote the following IIF statement that should have handled these situations and just filled in a zero:

=iif(Fields!RBC_Prev_Year.Value=0,0,(Fields!RBC.Value-Fields!RBC_Prev_Year.Value)/Fields!RBC_Prev_Year.Value)

The problem is, well it didn’t work.  My report would still end up with an #Error value in the column.  After some searching I found the solution on this website.

Essentially even though I was trying to handle the divide by zero issue with the IIF statement reporting services still evaluated each part of the statement before displaying the results which causes the error.

By re-writing it like this:

=iif(Fields!RBC_Prev_Year.Value=0,0,(Fields!RBC.Value-Fields!RBC_Prev_Year.Value)/
iif(Fields!RBC_Prev_Year.Value=0,1,Fields!RBC_Prev_Year.Value))

It works!  Weird, but oh well.

SQL Server Reporting Services repeat header row on each page from a table/tablix

Some things are not as they seem.  Like in the Tablix (data table) properties there’s a setting that says “Repeat header rows on each page.”  Checking this does not repeat the header rows on each page.

TablixProperties

I found some information elsewhere that says you also have to:

1. In the grouping pane, Go to advanced mode
(click on the small black down arrow on the far right of the grouping pane.  A bunch of bars that say Static will show up.)

AdvancedModeStatic

2. Select the corresponding (Static) item in the row group hierarchy.  (not the ones in the Column Groups side.  For me it was the first one in the Row Groups)
3. In the properties grid, set RepeatOnNewPage to true

Properties
4. KeepwithGroup to After
5. FixedData to True

After doing this my row headers started showing up on all pages.  A lot of work for something that seems like should have been taken care of by the first setting.

 

Alienware M14x with Windows 8 – USB 3.0 ports and Corsair thumb drives issue

alien

I have an Alienware M14x laptop and a few Corsair USB 3.0 thumb drives.  The thumb drives most of the time would not get recognized by Windows.  They throw an “unrecognized device” error when they are plugged in.  I can plug the same thumb drives into a USB 2.0 port on the same laptop and they work fine just not at USB 3.0 speeds which is not cool.  I can plug other USB 3.0 devices, like a Western Digital external hard drive, and they work just fine at USB 3.0 speeds.

After some searching I found some rather lengthy instructions here that fixed the problem perfectly for me and a co-worker with the same laptop.  Essentially the instructions walk you through getting Windows 7 drivers installed for the USB 3.0 hub and ports.

I imagine this applies to more than just the Alienware M14x and would work for other laptops as well.

SQL Server Reporting Services get a percentage of group total from column value

I have rows from a query such as:

Name                  Type            Quantity

Customer01       A N              5
Customer01       A P               4
Customer01       O N              3
Customer01       O P               2
Customer02       A N              3
Customer02       A P               9
Customer02       O N              5
Customer02       O P               7

So, I can do a grouping and get the total for each customer:  (using sum(Fields!Quantity.Value))

Customer01     14
Customer02     24

What I needed is on the report to then show what percentage of the total each line represented.

I finally found that the sum function has a scope you can define to do this.
So I ended up with an expression added to a new column out to the side of the Quantity column on the report that looked like this:

=Fields!Quantity.Value/sum(Fields!Quantity.Value,”table1_group_code”)

The “table1_group_code” is the name of the grouping where I needed the percentage calculated from.

You can find this name in the Row Groups area of the reports designer.

Capture

Windows Update Services shows Windows 8 x64 as Windows XP x64

My Windows 8 machine was not getting updates from our Windows Update Services server.
When I looked at my computer account it showed the operating system as Windows XP x64 which is definitely wrong.

I found the following instructions on Microsoft’s Technet site:

ReInstall KB2734608 (found here, scroll down towards the bottom for the actual download)
Open an elevated Command Prompt
net stop wuauserv
rd /s %windir%\softwaredistribution
y
Use regedit to delete HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate
net start wuauserv

This fixed my issue and my Windows 8 machines now report as having Windows 8 as their operating system and they immediately found updates that needed installed.

Windows 7 domain user keeps logging on with temporary profile

temp-profile

I recently had a computer replaced on our domain.  For some reason the domain account I was working with kept logging into Windows with a temporary profile.  I tried numerous fixes found on the Internet to no avail.  Then I thought maybe it had something to do with the fresh load of Windows and I nuked the machine and started over.  Still not working right.  I figured it must be something to do with the domain account but couldn’t figure it out.

On a whim I compared domain accounts with another account and found the affected account was a member of the guests security group and the domain guests security group.
I removed the account from both groups and the problem went away.  Not sure how or when the account got added to those groups but the problem was solved by removing membership to them.