Chrome white screen when using through TeamViewer

I recently had an issue where trying to use chrome over a TeamViewer session resulted in a white screen. This can happen if there is no physical display attached to the computer you are accessing, or if say, the laptop lid is closed. Chrome tries to render using the GPU to a display that doesn’t …

Read more

Windows Password Roll Script GUI

Back in may 2014, Microsoft released a patch to fix a vulnerability in Group Policy Preferences which left many people without a method for changing local account passwords. Happily, they also provided a powershell script to allow sys admins to do this. Whilst the script works, it isn’t very elegant or user friendly, indeed one of …

Read more

SCCM Client Cache Size

Recently I came across a situation where one of my SCCM deployments was failing due to the client cache being too small, now for new machines you can set this in your client installation settings, but for existing machines I needed another solution. For this, I created a small powershell script: $Cache = Get-WmiObject -Namespace …

Read more

How to unzip files in powershell

function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item,16) #16 answers Y to any prompts, eg overwrite } } #call the function so: Expand-ZIPFile -file “c:\myfile.zip” -destination “d:\somedestination”  

Windows Environment Variables

Variable Typical value (may vary) %ALLUSERSPROFILE% C:\ProgramData %APPDATA% C:\Users\(username}\AppData\Roaming %CommonProgramFiles% C:\Program Files\Common Files %COMPUTERNAME% {computername} %COMSPEC% C:\Windows\System32\cmd.exe %HOMEDRIVE% C: or sometimes D: %HOMEPATH% \Users\{username} %LOCALAPPDATA% C:\Users\{username}\AppData\Local %PATH% Varies. Includes C:\Windows\System32\;C:\Windows\ %PATHEXT% .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; .MSC %ProgramData% C:\ProgramData %PROGRAMFILES% Directory containing program files, usually C:\Program Files %ProgramFiles(x86)% In 64-bit …

Read more

KMS in a multi-tree forest

If you wish to create a multi-tree forest domain setup, and the root authority pays for the licenses, you only need 1 KMS server for the forest.  But the DNS service entry for KMS doesn’t replicate through the forest DSN tables by default.  To change this, make a registry change as follows (this assumes you …

Read more

Displaying Network Adapter Speed with WMI via the Win32 NetworkAdapter class

Quick little script to do the above.. Function GetNetworkSpeed(strComputer) Dim colItems, objItem, address Dim StrQuery Dim objWMIService StrQuery = “SELECT * FROM Win32_NetworkAdapter” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2″) Set colItems = objWMIService.ExecQuery(strQuery,,48) For Each objItem in colItems GetNetworkSpeed = GetNetworkSpeed & vbTab & objItem.ProductName & vbCr Next End Function