---
title: Home.md
date: 2020-11-16 00:00:00+02:00
draft: false
----

Powershell script: Find hotfix status

I was browsing around the requests on the Microsoft Script Center the other day and found one request where a user needed a PowerShell script for showing the status of specific hotfixes on multiple machines. I thought it would be a good idea since Get-Hotfix only shows where the hotfix is installed but not directly where its not installed. I created a simple small script that would list the patches to check for, along with each server and if its installed or not.

Powershell script: Write object to SQL

A while ago I was playing around with PowerShell, gathering information from a lot of servers and I felt that I needed to have a simple way of storing that information in a database. I could have written my own T-SQL statements for creating the tables and then do the inserts in the powerShell scripts I was playing around with. But that felt like it would just take time so I started to think about a function that would just accept any object and do the magic of creating a table and then inserting anything I piped to it.

Get-Type alternative for $null values

Sometimes its useful to get information about object properties in PowerShell. You might be writing a script where you want to extract information from a series of objects and you need to know what data type a property contains. Often this is not a big problem since you can use the GetType function that most objects have. Then you run in to the problem that I had recently: You expect a series of objects and you check the types on the properties and suddenly a few of them doesn’t have the function GetType for some reason.

Compress files to Zip with Powershell

I have seen a lot of people writing PowerShell scripts to compress files or folders by using external file compression programs. Often Winrar, 7-Zip or something similar is used since PowerShell does not have any built in cmdlet to do this (not until version 5 at least). There is however a pretty simple way of doing this with only PowerShell. This is how. # First we add the .Net framework class needed for file compression.

Enable real time JMX monitoring in Cognos

In Cognos BI its possible to enable JMX to be able to monitor the java engine. What IBM provides is not really what I was looking for. I wanted to be able to use for example VisualVM to see what happens in real time. This is how to enable the regular JMX monitoring in Cognos which comes out of the box with Tomcat. Open the bootstrap file which is located in the following path: %installpath%\Bin64\bootstrap_winx64.

Move data or log files for TempDB in SQL Server

Since TempDB is a system database you should not try to move the database with detach/attach or backup/restore. Instead you should move the files with a simple script and after the next restart of the instance the files will be relocated to the new location. First check where the files are currently located so that you can easily just copy and paste the name and paths if needed: SELECT name, type_desc, physical_name FROM sys.

Resources for RemoteFX in Windows Server 2012

While playing around with my lab machine and writing my previous two posts I found that there are not that much information to be found about RemoteFX in Windows Server 2012 so I thought that I would collect some good links on the subject. Most of the information I could find on TechNet is about Windows Server 2008 so some of the links below are from blogs elsewhere. I would also like to note that the focus here is on using RemoteFX for multimedia and using a virtual GPU.

RDP 8.0 for Windows 7 SP1

A few days ago Microsoft finally announced that they will be releasing Remote Desktop Protocol 8.0 for Windows 7 SP1. Earlier it was not clear if this would be released for Windows 7 or if RDP 8.0 would be exclusive for Windows 8 and Windows Server 2012. RDP 8.0 should give some proper improvements when it comes to hardware accelerated graphics in Hyper-V with the RemoteFX capabilities. Among many improvements there are some new compression algorithms which will lower the bandwidth needed for RDP sessions where some parts of the screen might use a different algorithm compared to other parts, and even mixing UDP and TCP on different parts of the screen depending on what’s displayed.

Improving RemoteFX performance in Hyper-V

As I wrote earlier its possible to run RemoteFX on some of the slowest GPU´s you can buy today (on a regular CPU actually), but you might not get the performance you need to get anywhere. This time I will go through some of the options you have for getting it to work a bit better. Keep in mind that I am writing this with a really poor GPU in mind (yes, the Intel HD 2500 is not good for anything else than browsing).

Configure RemoteFX in Hyper-V running Windows Server 2012 with low end GPU

This is for experimenting with RemoteFX in Hyper-V in a lab environment using Windows Server 2012. I wanted to see what I could do with RemoteFX on a slow GPU. To see how far I could get I started off with the Intel HD 2500, which is built into the Intel Core i5 3550 processor (Ivy Bridge). You can go through these steps with any supported hardware, and you probably get better results if you don’t use the HD 2500 as I did.