zondag 5 maart 2017

Display new and old style Windows OS versioning in PowerShell

The program winver.exe (About Windows) displays Windows OS version information by combining registry data values. I wrote a small PowerShell script to show the differences between the new (=> v10.0) and the old (<= v6.3) OS versioning format. Tested on Windows 8.1, Windows 10 and Windows Server 2012 R2.

W10 winver.ps1
W10 winver.ps1
The variable MMBR strings the major, minor, build and revision number together. If the registry has no entry for the major or minor number, the missing value in MMBR is shown as EMPTY. If the major and the minor value are both missing, they get replaced by the old version number.

W12R2 winver.ps1
W12R2 winver.ps1

winver.exe
winver.exe old and new versioning

winver_0.2.ps1:

# Ron Bos, rethinkit.nl, 2017, v0.2
write-host `
`n"Edition:"(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').ProductName `
`n"Version:"([String]$Version=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentVersion)`
`n"Release:"(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').ReleaseID `
`n `
`n"Major:"([String]$Major=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentMajorVersionNumber) `
`n"Minor:"([String]$Minor=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentMinorVersionNumber) `
`n"Build:"([String]$Build=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').CurrentBuild) `
`n"Revis:"([String]$Revision=(gp 'HKLM:Software\Microsoft\Windows NT\CurrentVersion').UBR)

if (($Major) -and ($Minor)) {
$MMBR=(echo MMBR : $Major"."$Minor"."$Build"."$Revision)
write-host $MMBR -foregroundcolor green
}
if (($Major) -and !($Minor)) {
$MMBR=(echo MMBR : $Major"."EMPTY"."$Build"."$Revision)
write-host $MMBR -foregroundcolor green
}
if (!($Major) -and ($Minor)) {
$MMBR=(echo MMBR : EMPTY"."$Minor"."$Build"."$Revision)
write-host $MMBR -foregroundcolor green
}
if (!($Major) -and !($Minor)) {
$MMBR=(echo MMBR : $Version"."$Build"."$Revision)
write-host $MMBR -ForeGroundColor green
}
pause

vrijdag 23 september 2016

Apple's Home Sync is depricated in macOS Sierra

Apple's Home Sync is depricated in macOS Sierra (10.12). Therefore I am implementing a Mac server app Time Machine repository for use with Mobile accounts and Local home folders.

I'm posting my Home Sync configuration here before deleting the current setup.

A Custom Settings payload in Profile Manager to battle the conflict errors and bugs:

Custom Settings plist: com.apple.homeSync

Open Directory configuration for OS X <= 10.6:

MCXFlags.txt


MCXSettings.txt

The MCXSettings consists of the creation of a Mobile account at first login and the  com.apple.homeSync.plist.