September 25 2017

Windows 10 + CorelDraw X3 = Startmenü defekt

Quick & Dirty

Fehler: CorelDraw X3 installiert (setup.exe lässt sich unter Win10 nicht mehr ausführen, Workaround ist die setup.msi + de.msi zu installieren), danach funktioniert weder das Startmenü noch Modern/Store Apps.

Lösung: regedit ausführen, Berechtigungen für HKEY_CLASSES_ROOT überprüfen. Scheinbar wirft hier das Corel MSI die „ALL APPLICATION PACKAGES“ raus. Sobald diese wieder eingetragen sind, funktioniert wieder alles…

September 13 2017

NTFS Berechtigungen anhand Ordnername setzen

Neuer Fileserver, neue Homedrives… Diese liegen alle in einem Verzeichnis und haben als Ordnername den Username. Auf dem Ordner muss der User berechtigt werden (NTFS ACL). Dies kann mit folgendem Powershell Script schnell und einfach erledigt werden:

Download des Script

 


#############################################################################
# Script: changePermissions.ps1
# Author: Internet & Luis Goncalves & Rui Duarte & Manuel Kuss
# Date: 13/09/2017
# Keywords:
# Comments: Fixed Version for Powershell v3
# Pre-Requisites: Full Control over destination folder.
#
# DISCLAIMER
# ==========
# THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
# RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
#############################################################################
#
# Where is the root of the home drives?
$homeDrivesDir="F:\DATA"
# Report only? ($false = fix problems)
$reportMode = $false
# Print all valid directories?
$verbose = $true
# What domain are your users in?
$domainName = "DOMAINNAME.LOCAL"
#
# ACL Options:
# Grant the user full control (FullControl, Modify, ...)
$accessLevel = "Modify"
# Should permissions be inherited from above? (ContainerInherit, ObjectInherit or None)
$inheritanceFlags = "ContainerInherit, ObjectInherit"
# Should permissions propagate to below?
$propagationFlags = "None"
# Is this an Allow/Deny entry?
$accessControlType = "Allow"
#############################################################################
# Save the current working directory before we change it (purely for convenience)
pushd .
# Change to the location of the home drives
set-location $homeDrivesDir
# Warn the user if we will be fixing or just reporting on problems
write-host ""
if ($reportMode) {
Write-Host "Report mode is on. Not fixing problems"
} else {
Write-Host "Report mode is off. Will fix problems"
}
write-host ""
# Initialise a few counter variables. Only useful for multiple executions from the same session
$goodPermissions = $unfixablePermissions = $fixedPermissions = $badPermissions = 0
$failedFolders = @()
# For every folder in the $homeDrivesDir folder
foreach($homeFolder in (Get-ChildItem $homeDrivesDir | Where {$_.psIsContainer -eq $true})) {
# dump the current ACL in a variable
$acl= (Get-Item $homeFolder).GetAccessControl("Access")
# create a permission mask in the form of DOMAIN\Username where Username=foldername
# (adjust as necessary if your home folders are not exactly your usernames)
$compareString = "*" + $domainName + "\" + $homeFolder.Name + " Allow FullControl*"
# if the permission mask is in the ACL
if ($Acl.AccessToString -like $compareString) {
# everything's good, increment the counter and move on.
if ($verbose) {Write-Host "Permissions are valid for" $homeFolder.Name -backgroundcolor green -foregroundcolor white}
$goodPermissions += 1
} else {
# Permissions are invalid, either fix or report
# increment the number of permissions needing repair
$badPermissions += 1
# if we're in report mode
if ($reportMode -eq $true) {
# reportmode is on, don't do anything
Write-Host "Permissions not valid for" $homeFolder.Name -backgroundcolor red -foregroundcolor white
} else {
# reportmode is off, fix the permissions
Write-Host "Setting permissions for" $homeFolder.Name -foregroundcolor white -backgroundcolor red
# Add the user in format DOMAIN\Username
$username = $domainName + "\" + $homeFolder.Name
try {
# Create the Access Rule
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($username,$accessLevel,$inheritanceFlags,$propagationFlags,$accessControlType)
# Attempt to apply the access rule to the ACL
$Acl.SetAccessRule($accessRule)
Set-Acl -Path $homeFolder -AclObject $Acl
# if it hasn't errored out by now, increment the counter
$fixedPermissions += 1
} catch {
# It failed!
# Increment the fail count
$unfixablePermissions += 1
# and add the folder to the list of failed folders
$failedFolders += $homeFolder
}
} #/if
} #/if
} #/foreach
# Print out a summary
Write-Host ""
Write-Host $goodPermissions "valid permissions"
Write-Host $badPermissions "permissions needing repair"
if ($reportMode -eq $false) {Write-Host $fixedPermissions "permissions fixed"}
if ($unfixablePermissions -gt 0) {
Write-Host $unfixablePermissions "ACLs could not be repaired."
foreach ($folder in $failedFolders) {Write-Host " -" $folder}
}
# Cleanup
popd

 

Die Powershell v2 Version ist ursprünglich von hier.

September 6 2017

Quick and Dirty Referenz PC für OSD

Aktuell baue ich an einem neuen Referenz Image für Windows 10 mit Office 2016 in mehreren Sprachen. Hier gibt es viele Wege die ans Ziel führen können, den automatischen Build and Capture Prozess vom ConfigMgr, eine MDT Task Sequenz oder das ganze manuell durchzuführen. Aus unterschiedlichen Gründen baue ich eine Referenz PCs derzeit noch von Hand, dazu eine kleine Quick and Dirty Vorgehensweise:

  1. Eine neue VM mit möglichst wenig Hardware erstellen (SATA, kein Sound, keine Drucker, …)
  2. Windows 10 aus dem aktuellesten Image in Englisch installieren, einen Dummy User anlegen
  3. Windows 10 aktivieren
  4. Alle benötigten Sprachpakete aktivieren und herunterladen
  5. .NET 3.5 Feature und Middleware installieren (VC++ Runtimes)
  6. Office 2016 inkl. Sprachpaketen installieren (dazu verwende ich die Source der SCCM Application)
  7. Windows Update inkl. Office
  8. Den Builtin Administrator Account aktivieren, sich mit diesem anmelden
  9. Den Dummy User inkl. Profil löschen, Cleanup durchführen
  10. Einen VM Snapshot erstellen und das Referenz Image abziehen

Braucht man nun ein Update dann kann man quasi mit den Windows Updates beginnen, das Cleanup durchführen und das Capture durchführen.

 

Client Cleanup Schritte:

  1. Festplatten Bereinigungstool laufen lassen (cleanmgr.exe)
  2. hyberfil.sys entfernen (powercfg -H off)
  3. Windows Updates löschen (net stop wuauserv ; del %windir%\SoftwareDistribution /q /s ; net start wuauserv)
  4. dism.exe /online /Cleanup-Image /RestoreHealth
  5. dism.exe /online /Cleanup-Image /StartComponentCleanup /ResertBase

 

Das so erzeugte Image hat mit Win10/Off2016 und 6 Sprachen derzeit 9,8GB.