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

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.

SQLPS and its limitations

SQL Server PowerShell (SQLPS) enables some new possibilities when it comes to managing your instances, but it also comes with some limitations. These limitations are not always obvious and can sometimes be worked around. To understand the limitations you must first understand that SQLPS is not PowerShell V1, V2 or V3 but rather a mini shell on its own. It was created by Microsoft as a mini shell based on PowerShell V1 so the cmdlets available are based on V1.

Script deployment of SSIS packages from folder

This is a very easy way to automate something which can take quite some time to do manually if you have lots of environments. Its made as easy as possible in this example rather than fancy and complicated. This script will create a SQL Server Agent Job which will execute a number of SSIS packages (dtsx files). The script will look for dtsx files in the selected folder DTSVirtualPath and also a config file (dtsConfig).