Dism.exe Cleaning Up Invalid Images

After finishing editing and wim image using dism I was being left with Windows still thinking the image was still mounted somehow and not able to remount the image file.
Thanks to a post here I finally managed to resolve the issue by deleting keys under “HKLM\SOFTWARE\Microsoft\WIMMount\mounted images\”

Next I just need to find how to be able to delete the folders ProgramData\Microsoft\Windows\SystemData underneath the root of a mounted image after it’s been unmounted. Windows is locking them but there are no handles open to them

[Solved] WDS Driver Filters Not Working

Like many people it seems I’ve been scratching my head as to why  WDS’s Driver Package Filters were not matching my hardware when imaging a machine that I’d created a driver package group for.

After looking at Greg Shields technet post I was convinced I just needed to grab the model name straight off of the machine type beforehand via a powershell WMI get and I’d be laughing. Alas this still did not work.

I found the best way was to enable the Debug log on WDS, then pull the info directly from what WDS was seeing and use that to create the filters.
I’ve also written a powershell script to pull the details from the debug log as otherwise it takes a fair bit of time.
I’ve posted this here:
https://github.com/mikedixson/Get-SMBios-Strings-From-WDS

Powershell list all properties of an object

Some powershell get commands only output a handful of the object properties get-CalendarProcessing being one such command, than returns just one property.

To get all properties of an object you can pipe to format-list *
get-CalendarProcessing -identity [email protected] | Format-List *

If you know the specific attribute you are after you can still access this variable using select-object.
get-CalendarProcessing -Identity [email protected] | Select-Object AllowConflicts

Get Boot Time For all computers in an OU – Powershell

I wrote the following script enumerates an OU and then looks up the last boot time for each computer.

https://github.com/mikedixson/GetLastBootTimeFromOU

Note: I’m starting to put any scripts I write on GitHub, this will make it easier for you copy down and easier for me to keep any scripts up to date.

Easy GPO Audit Using Powershell

After poking around the Group Policy Objects (GPO) of an infrastructure that was new to me I needed a decent way of producing a quick and useful report on the state of the GPOs.

Because the ComputerVersion and UserVersion numbers are listed as two figures, one for AD and one for Sysvol just an export-csv of get-gpo left me with blank ComputerVersion and UserVersion.

I found this post: https://community.spiceworks.com/topic/551588-get-gpo-userversion-and-computerversion-troubles

By using the following powershell I was able to within minutes provide useful information on the state of the GPOs.

get-gpo -all | select Displayname,ID,Description,GPOStatus,CreationTime,ModificationTime,@{Label="ComputerVersion";Expression{$_.computer.dsversion}},@{Label="UserVersion";Expression={$_.user.dsversion}}| export-csv gpo-audit.csv

A small bit of conditional formatting later and we can see that the Domain GPO has a large amount of user setting edits and should be split into a user only GPO and a computer GPO (I won’t go into where these GPOs should be linked at this stage).
A snipping of an excel spreadsheet with colour coding providing meaning to the figures

SOLVED: False cursor position when entering and editing text in a cell in Excel

Similar to this article I was experiencing a false cursor position and the cursor position and text shifting when editing versus when viewing the cell

I played with the formatting and found that enabled LTR (Left to right formatting) helped, at least made it usable to edit the cell.

However I found the solution for me was to change the font!! Somehow the font the problem cell had become formatted as MS Shell DG font (a font I can’t actually see in the font browser now).
Changing the cell’s font back to the default Calibri resolved the issue!

I’m running Version 1708 (Build 8431.2131 Click-to-Run)

FIXED: Varnish Caching Proxy Expected an action, ‘if’, ‘{‘ or ‘}’

So it seems Varnish 4.0 and 4.1 (more may be affected this is the limit of my testing presently) has a bug where some whitespace can through it from recognising valid configuration such as below
# ACLs to control who can access this caching proxy server
acl local {
"127.0.0.0"/8; /* loopback range */
"192.168.1.0"/29; /* local network range 192.168.1.0-192.168.1.7 */
"10.0.0.0"/8; /* For testing on own hown network - REMOVE FOR PRODUCTION */
}

######################
# Urls to cache
# /api/3.0/artists/
# /api/3.0/venues/
#####################

sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don’t need,
# rewriting the request, etc.

if (client.ip !~ local ) {
{error 403 “Access denied”;}
}
return (lookup);

# We only want to cache GET request
if (req.request == “GET”) {
return(hash);
}
}

 

This was due to a bad code merge cited here https://github.com/nexcess/magento-turpentine/pull/1311

You can resolve this by manually removing the whitespace by using the command below

cat default-withWhiteSpace.vcl | tr -d " \t\n\r" > default.vcl