Today I had the simplest of tasks to do. Make some software available for some users.
I always test out the software first to see if there are any issues etc.
I was given a CD with a piece of software on it, a single exe with a Username and Password to run it.
That didn’t work? After several attempts, I paid a bit more attention and realised that the Username and Password details were printed in reverse. I skim read the CD and see that it said Username and Password but didn’t notice they were the wrong way around!
So I swapped the Username and Password around and tried it again. Still no joy!

I left it for a bit as I had other stuff do and came back to it just before lunch.
I had a quick read of the manual and that told me a Username and Password combination the same as what was on the CD but the other way around! However, I had already tried it both ways!

I copied the exe onto my desktop and popped the CD out of the drive and run the program again making sure that I had typed the password in correctly. This time it worked? WTAF?
I then put the CD back in and tried it again only to get the same error as before?
I then loaded up the manual to have another read only to find a sentence saying that you have to copy the exe onto your computer for it to work? Err I guess I must have missed that bit. Ooopps!

Being an IT Pro! I never read the manual 😉 maybe I should try that from now on!

Unable to join the domain?

Today I set about installing a new server to replace an old one. This was going to be a Virtual Server on our Hyper-V cluster.

I have built enough servers of varying OS versions on Hyper-V enough times to not even think about what I am doing so was a tad surprised when it failed to join the domain.
A quick check of everything showed nothing obvious, as sometime I do make the odd stupid mistake!
The server had a DHCP IP address, I could ping IPs on the network, I was able to download files from the internet – which were about all I normally do before joining a new server onto the domain.
I let the server update itself with the latest OS updates and reboot, but that made no difference.
I then set about checking out the NetSetup.log and work through any issues in there.
After checking that and getting nowhere and starting to lose interest I decided to move the VM to a different node and try and add it to the domain again. This time it worked!

I really have no idea what that is as I have not had that issue before and have joined servers on to the domain with not issues plenty of times.
Maybe if I have a lull in work I will revisit, but as I have looooaads to do I don’t think that will happen anytime soon.

OICE_15 Folders

After being plagued with hundreds of OICE_15_XXXXXXX folders and the pain in the arse to get rid of them I have decided to make my life a tad easier today.

I have seen these folders being created under AppData in the roaming profiles of users, they get copied up and down as the user logs on and off and ultimately end up causing the roaming profiles not to sync as they are over quota.

I can’t add them to folder exclusions as they are all different and I can’t find a way to move them or stop them being created. We have to delete them as and when we come across them and they are not always easy to delete as some of the file are dot files and windows says it’s not there when you try and delete it! WTF FFS

I normally browse to the folder, shift right click and select `Open Command windows here‘, go into each folder and delete the dot files, then delete the folders. But it takes for bloody ever as I have to do that on the computers and on the server where the OICE_15 folders are.

To make life easier I have added an extra context menu to the right click menu for folders called `KillDOTFiles`

Windows Registry Editor Version 5.00
@=""C:\Windowskilldotfile.bat" %1"

Created a batch file that had the following contents

for %%a in (%1) do set temp=%%~nxa
set OICEDir=%temp:~0,4%
if /I NOT %OICEDir% == OICE (
rem echo No
) ELSE (
rem echo Yes
del %1*.* /q /f
rd %1 /s /q

Now all I need to do is highlight the folders, right click and they get deleted.

Ive added a bit of checking to the batch file, as if I give the file to anyone else i do not want to be held liable if they delete the wrong directory! It will happen!!

Why did I not think of doing this before?

QuickTime Issues – Poxy Apple Software

What a waste of 3 days this has been!

A problem was reported to me – someone couldn’t view a webpage with a QuickTime move in it.
Given that QuickTime was in need of an update as it was well out of date, I decided to update it first.

I am really not sure what the hell was going on, but it was plagued with errors. The main one being when I created the deployment package in SCCM it deployed the Apple Application Support MSI but then failed deploying the QuickTime MSI. The Apple Application Support MSI was a dependency of the QuickTime MSI. That worked fine but the QuickTime MSI failed saying that a version of QuickTime was already installed.
So I deployed a clean image to my test machine that included QuickTime and set about deploying the new version of QuickTime. Same error again – a version of QuickTime was detected again. Ok so much for upgrade! So I removed all Apple components and deployed QuickTime again. The same error.
I double checked and went through the registry and removed every Apple reference, went through ProgramData and removed everything Apple and in Program Files and Common Files etc. With everything gone I deployed it again. The same error?!?!

I then decided to run the MSI files manually. The Apple Application Support installed fine, but the QuickTime failed again with the same error.
This time I ran SysInternals Process Monitor to capture everything so I could see what was going on.

Several hours later I came across a registry entry that looked like it was causing the error. I deleted it and run the QuickTime MSI again only to find the registry key was back and so was the error. Now that made no bloody sense at all?
Thankfully I had a weekend to forget about that crap and start a fresh on Monday, which seemed to work as I redone the 2 deployments in SCCM and it then installed Apple Application Support and QuickTime with no issues. I really do not know what happened there, as nothing was different.

So, back to the original reason for doing this, I checked the online video and it still didn’t play.
So after all that faffing I was no further forward!
I then renamed my roaming profile and logged in and tried it again. This time it worked!
I looked through the roaming profiles folder to see what Apple stuff I could find, but as I severely limit what is allowed to roam there was no Apple files / folders there.
I then coped the old registry file over and logged on again – movie didn’t play again.

So the issue was with the registry.
I loaded up regedit and went through all the references to Apple or Quicktime that I could find, deleting all then one at a time then trying the online video again.
I finally came across a key called

HKCU/Software/Microsoft/Internet Explorer/Internet/Registry/REGISTRY/USER
[SID]/SOFTWARE/Apple Computer, Inc./QuickTime/LocalUserPreferences

With a setting called FolderPath that was set to an invalid location.
I changed the location to a valid one and hey presto it worked! FFS

It’s so nice to see Apple software that is enterprise friendly!

SCCM upgrade from 2012 SP1 to 2012 R2 + CU

So, finally I have finished upgrading all of our clients to the latest version and CU of the SCCM client.

To say it has been a challenge is an understatement.

You would think that given what SCCM is used for that it would be easy and quick to do, but no.

There were just over 400 machines and once I upgraded the server form SP1 to R2 and then updated it to the latest CU I had to deploy the R2 client and then deploy the update to CU4.

The R2 client seemed to get deployed quiet easy, there were a few machines that for some reason had really really old SP1 version on them. For those, there were a few that didn’t like the upgrade, so I had to uninstall the old client and then deploy the new one.

I then set about deploying the CU4 update to all machines. There was a bunch that wouldn’t update, no matter how long I left it and no matter how many times I forced an Application Deployment Evaluation Cycle it stayed on the old version.

I had a SQL query listing all the machines on the old version, the started off about 49.

I found it easier to remote on and manually uninstall the client, wait for all processes to terminate, rename the old SCCM directory and then reboot the machine. I figured that out after a bit of trial and error trying to get things off and on again!

So, thinking I had it sussed out, I was somewhat surprised when I refreshed my query one morning to find the number of machines had increased. Looking closer it was a few machines from the Labs.

RDPing on showed that the version was indeed the old version. I really couldn’t be bothered to see what the hell was going on as it had been a good few weeks that I had been trying to do this and people not logging off! and machines in locked rooms that didn’t work with WOL were doing my nut in.

So for each of those I applied my fix – remove the old client, wait for processes to terminate, rename the old CCM directory, reboot the machine, deploy the new client via SCCM and then deploy the update. That seemed to work for every computer that somehow managed to downgrade its client version on a reboot!?

Now to package and deploy the growing list of application updated that are needed.

Only those browsers? Really?

Well today I see another example of ridiculous browser wars at its best, or is that worst!

While looking at some issues on a CMS system, I picked the page apart find a very old version of a JavaScript component.

As I was using the latest version of Internet Explorer we had to play around with compatibility to get this website to work. After changing the User Agent String we were presented with a page saying that said that our browser was out of date. Fine, yes we may of made it report that it was out of date, which is something that seems to happen on an almost daily basis to some website here and there, but the options that we were presented with on the screen was ridiculous – upgrade your browser to Firefox, Chrome or Safari? Seriously? WTF? BOFW?

Not sure why they had chosen to completely remove Internet Explorer from the preferred list, but given what the website provider does and the sector that they are selling / providing to and given how systems are configured in that sector removing Internet Explorer has got to be one of the most stupid things to do.

I don’t give a shit what the Internet Explorer hatters have to say about that, sometimes there are reasons as to why you can only use certain software to do a job, and no matter what you do you need to cater for those scenarios.

Hopefully when the issue is fixed Internet Explorer will on the list of preferred browsers!

TechNet Subscriptions

Microsoft have decided to retire their TechNet Subscription service

I signed the “Continue TechNet or create an affordable alternative to MSDN” petition to show my support for keeping the Microsoft TechNet Subscription service going.


As an IT Professional I use the software a hell of a lot to test things out and set up test environments. Some environments I have had going for well in excess of a year and having to rebuild them regularly would be a right pain to say the least!

I don’t know any fellow IT Pro’s that could afford an MSDN subscription to match the TechNet one.

If you are a TechNet Subscriber then sign the petition and show your support for keeping it going.

Microsoft, please continue the TechNet Subscription Service.

Thank you

SCCM 2012, PowerShell and Printer Share Creation

Today I wrote a couple of quick PowerShell Scripts to get shared printers from all computers on the domain, and another one to take the data returned and use it in an OSD Task in SCCM 2012 to create the shares printers when we deploy Windows 7.

The first script is as follows

# By Gary Rice
# V1 - 14/05/2013
# Printer information for import needs to be as follows
# $Printers = "HP LaserJet 4250 PCL6","Kyocera FS-1030D KX"
# $Computers = "MININT-HJ0UIN4","MININT-LR30CVS"
# $Sharenames = "MININT-HJ0UIN4-HPLJ4250","MININT-LR30CVS-FS1030D"

$OutPut = ""

$NL = [Environment]::NewLine
$FileName = Get-Date -format "yyyy-MM-dd-HH-mm-ss"
$Filename += ".txt"
$C = ""
$Pstring = "`$Printers = "
$Cstring = "`$Computers = "
$Sstring = "`$Share = "

$OutPut += "Computer,Printer Name,Printer Driver,Printer Share Name" + $NL
$OU = "OU=Desktop Computers,DC=test,DC=internal,DC=snowey,DC=com"
$DomainComputers = Get-ADComputer -SearchBase $OU -Filter `*` | Select-Object -ExpandProperty Name

foreach($Computer in $DomainComputers)
    if(!(Test-Connection -Cn $Computer -BufferSize 16 -Count 1 -ea 0 -quiet))
        $OutPut += $Computer + "," + "Error" + $NL
        $Printers = get-wmiobject -computername $Computer -query "select * from win32_printer"
        foreach ($Printer in $Printers)
            if($Printer.Shared -eq "True")
                $OutPut += $Computer + "," + $Printer.name + "," + $Printer.drivername + "," + $Printer.ShareName + $NL
                $Pstring += $C + "`"" + $Printer.drivername + "`""
                $Cstring += $C + "`"" + $Computer + "`""
                $Sstring += $C + "`"" + $Printer.ShareName + "`""
                $C = ","

$FilenameFN ="Computers-Printers-" + $Filename
$Output | Out-File $Env:Temp$FileNameFN
Invoke-Expression $Env:Temp$FileNameFN

$OutPut = $Pstring + $NL + $Cstring + $NL + $Sstring
$FilenameFN ="Computers-printers-OSD-String" + $Filename
$Output | Out-File $Env:Temp$FileNameFN
Invoke-Expression $Env:Temp$FileNameFN

It’s not very complex, it just goes off and gets all the computers in a specific OU, checks that are active then loops through all the printers and if any are shared it saves the computer name, printer driver name and share name to file. I had to use printer driver name as the Printer name was not always accurate or what it should be due to historical renaming.

Then, the script that I included in the OSD Task Sequence was

# By Gary Rice
 # V1.1 - 15/05/2013
 # Uses `Shared Printers on Domain Computers.PS1` to generate data
 # To be run as part of SCCM 2012 OSD Task

$Count = 0
 $Printers = "HP LaserJet 4250 PCL6","Kyocera FS-1030D KX"
 $Computers = "MININT-HJ0UIN4","MININT-LR30CVS"
 $Shares = "MININT-HJ0UIN4-HPLJ4250","MININT-LR30CVS-HPLJ4250"

foreach ($Computer in $Computers)
 if ($Computer -eq $env:computername)
 $TargetPrinters = get-wmiobject -computername $Computers[$count] -query "select * from win32_printer"
 foreach ($Printer in $TargetPrinters)
 if ($Printer.name -eq $Printers[$Count])
 $Printer.shared = $true
 $Printer.sharename = $Shares[$Count]
 $Count += 1

Again very simple, it takes an array of computers (printer names and share names) and loops through them until it finds a match. It then loops through all the printers on the local machine until it finds one that matches Printer Driver and then it creates the share.

There might be a different / easier way of doing this, but when you need something quick.

Hopefully someone might find them useful (or not).

IE10, desktops.exe and noframemerging

Today I upgraded my Windows Server 2008 R2 server to IE10.
Having used it on my work pc and my various Windows 8 installations for a while I thought it’s time to upgrade my server.
A quick install and reboot and it’s all done.

As I use my server for most of my work, it’s on all the time as it hosts Yodacam and is accessible remotely, it is a god send to have it all there when you need it.

I use Desktops from SysInternals to split up my work on to 4 separate desktops to keep the clutter to a minimum. My desktops are split into the following

Main Desktop – various email accounts, web browsing, Excel, Word etc
Development Desktop – php/asp.net websites, mysql and any think VB.net
[Undisclosed] Desktop – used for an [Undisclosed] task
Remote Access Desktop – for RDP/TS sessions to various computers and servers

I was working away on the Main Desktop and the Remote Access Desktop when i needed to do some work on some php files. Loading up a IE10 browser windows resulted in nothing showing. So I clicked it again but still nothing. I checked Task Manager and could not see anything that looked like a hung iexplore.exe process but there was nothing.

I then switched to the Main Desktop only to find several new IE10 windows open on the desktop. It would appear that every time I clicked the IE icon it would open a new window on the main desktop, which is not how it was in IE9.

I done a bit of digging and found a switch for IE10, `-noframemerging` which said `Internet Explorer 8 and later versions. Prevents Internet Explorer from opportunistically merging new frame processes into existing frame processes.`

I created a new shortcut to IE10 and added the -noframemerging switch to it. Now every time i load up a IE10 window it opens on the correct desktop.

Oh and Yes i know other browsers are available to use and I now there are other multiple desktop programs out there, but I am used to using IE and Desktops.exe and will continue to do so. GOI