Comments (7)
This issue should now be resolved in the beta 3.6.4 located here: https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/tree/master/Toolkit/AppDeployToolkit
Please test and let me know if it's working as expected now.
from psappdeploytoolkit.
Hi
I have first to excuse myself because i've a (couple of) mistakes :
1/ The path to check for the Computer GPO is :
HKLM\SOFTWARE\Policies\Microsoft\MUI\Settings' -Value 'PreferredUILanguages'
2/ I also made a Typo because in "PreferredUILanguages" I forgot the 1 "rr"
Enough with my errors, and after correction in you code , now the results
-- The detection for the "free" (no GPO applied) works fine
-- But the Detection for setting by GPO so far i not working : It gets only the "free" setting, the one I speak about in the previous Point. I've spent countless of hours to figure out where the problem might be (Typo, registry wrong path) and of course I didn't find something so far. I behaves just like for whatever reason the script can not read the EXISTING registry keys. The thing I've noticed is that for the GPO the Value is REG_SZ and for the "free" setting is REG_Multi_SZ .. I am a bit out of idea since I can not trace $HKULanguages after each reading in the registry.. that would really help (If I use the write-log function with the variable, the script just does not run.. but I might be wring somewhere or the value read is somehow "out of range)
My code :
'# If a user is logged on, then get primary UI language for logged on user (even if running in session 0)
If ($RunAsActiveUser) {
# Read language defined by Group Policy
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKLM\SOFTWARE\Policies\Microsoft\MUI\Settings' -Value 'PreferredUILanguages'
}
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\SOFTWARE\Polices\Microsoft\Control Panel\Desktop' -Value 'PreferredUILanguages' -SID $RunAsActiveUser.SID
}
# Read language for Win 8 machines
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\International\User Profile' -Value 'Languages' -SID $RunAsActiveUser.SID
# Read language for Win Vista/Win 7 machines
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop' -Value 'PreferredUILanguages' -SID $RunAsActiveUser.SID
}
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop\MuiCached' -Value 'MachinePreferredUILanguages' -SID $RunAsActiveUser.SID
}
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\International' -Value 'LocaleName' -SID $RunAsActiveUser.SID
}
# Read language for Win XP machines
If (-not $HKULanguages) {
[int32]$HKULocale = Get-RegistryKey -Key 'HKCU\Control Panel\International' -Value 'Locale' -SID $RunAsActiveUser.SID
If ([string]$HKULocale) {
[int32]$HKULocale = '0x' + $HKULocale
[string[]]$HKULanguages = (Globalization.CultureInfo).Name
}
}
from psappdeploytoolkit.
Back On the desk
I finally out what the problem was. Since I 've found a way to trace the variable -Big deal ;-) - I've quickly discovered that it was very well detected for the GPO setting BUT after that the script tries to read the variable for "Win 8"... and since, obviously, it does not exist on Win7, it is reset to a null value. Therefore when it comes to the "free" setting the test sees a null variable and the sets it to the free setting. To make it shorter : the test on Win 8 was missing.
That's the code that is working for me on Win7 x64 :
'# If a user is logged on, then get primary UI language for logged on user (even if running in session 0)
If ($RunAsActiveUser) {
# Read language defined by Group Policy
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKLM\SOFTWARE\Policies\Microsoft\MUI\Settings' -Value 'PreferredUILanguages'
}
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\SOFTWARE\Policies\Microsoft\Control Panel\Desktop' -Value 'PreferredUILanguages' -SID $RunAsActiveUser.SID
}
# Read language for Win 8 machines
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\International\User Profile' -Value 'Languages' -SID $RunAsActiveUser.SID
}
# Read language for Win Vista/Win 7 machines
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop' -Value 'PreferredUILanguages' -SID $RunAsActiveUser.SID
}
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop\MuiCached' -Value 'MachinePreferredUILanguages' -SID $RunAsActiveUser.SID
}
If (-not $HKULanguages) {
[string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\International' -Value 'LocaleName' -SID $RunAsActiveUser.SID
}
# Read language for Win XP machines
If (-not $HKULanguages) {
[int32]$HKULocale = Get-RegistryKey -Key 'HKCU\Control Panel\International' -Value 'Locale' -SID $RunAsActiveUser.SID
If ([string]$HKULocale) {
[int32]$HKULocale = '0x' + $HKULocale
[string[]]$HKULanguages = (Globalization.CultureInfo).Name
}
}
from psappdeploytoolkit.
Thanks for testing out the beta 3.6.4. I've made the appropriate changes as discussed above. Please test the latest code again and let me know if it's working as expected.
from psappdeploytoolkit.
Hi
I'll will test on thursday and let you know
Best regards
from psappdeploytoolkit.
Hi
So I did all the test i could foresee and it works well in any configuration on Win7x64 except in only in one case : the User GPO. The right registry key is
'HKCU\Software\Polices\Microsoft\Control Panel\Desktop'
and in the code it is :
'HKCU\Software\Polices\Control Panel\Desktop' (line 254) : 'Microsoft' key is missing
Best regards
from psappdeploytoolkit.
Great, thanks for all your help. I've updated the code with the right key.
from psappdeploytoolkit.
Related Issues (20)
- [Bug] Remove-File doesn't like single quotes. HOT 4
- Show-InstallationWelcome[Feature]
- [Feature] Remove-EXEApplications HOT 1
- [Feature] Allow Get-InstalledApplication to also retrieve user context applications HOT 5
- [Bug] Show-InstallationPrompt via MCM/SCCM is not displayed for interactive installations HOT 7
- Zip Structure folder changed after v3.9.2 HOT 1
- How to use the AppDeployToolkit with Ivanti EndPoint Manager ? HOT 2
- PSAppDeployToolkit version 3.10.0 Deploy-Application.exe doesn't start when display language is set to Finnish HOT 1
- Show-InstallationWelcome not prompting to close software when pushed as a system account HOT 11
- Update Function Show-InstallationWelcome HOT 4
- "QuietUninstallString" and "WindowsInstaller" in Get-InstalledApplication (Follow-up of: https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/issues/652) HOT 2
- ClosePrompt_ButtonClose to small with german text HOT 5
- Is this a dead variable? HOT 3
- [Bug] Configure-EdgeExtension errors on line 16517 char:40 - Add-Member : Cannot bind argument to parameter 'InputObject' because it is null. HOT 1
- [tanslation] <BalloonText_FastRetry> German Translastion
- [Bug] HOT 1
- Incorrect information with 'Set-ItemPermission' reference in docs - 'https://psappdeploytoolkit.com/docs/reference/functions/Set-ItemPermission/' HOT 1
- [Documentation] Copy-File documentation needs more info
- [Feature] Pauze after deffer period HOT 2
- [Bug] Activesetup not applying for current logged on user HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psappdeploytoolkit.