Forum Discussion
DamianL1984
Oct 14, 2022Brass Contributor
Disable Exclusive Mode for All Audio Devices via PS
Hi all 🙂 Currently I am working on a script that will disable Exclusive Mode for all audio devices in Windows 10. So far I created this script: $Registry_Key = "HKLM:\SOFTWARE\Microsoft\Win...
DamianL1984
Oct 14, 2022Brass Contributor
So the problem is lack of permission for NT Authority System account. I had to ran regedit with Trustedinstaller permissions, add full permission for NT Authority System and then script starts to works deployed via SCCM.
So right now I am wondering if there is possibility to change registry permission through sccm as the script will be needed to run with trustedinstaller permissions?
So right now I am wondering if there is possibility to change registry permission through sccm as the script will be needed to run with trustedinstaller permissions?
DamianL1984
Oct 20, 2022Brass Contributor
Finally I was able to solve that issue by creating two scripts.
1. It uses SetACL.exe to take ownership of registry key by System account and set privileges to that account:
cd ".\SetACL"
SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture" -ot reg -actn setowner -ownr "n:NT Authority\System" -rec Yes
SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture" -ot reg -actn ace -ace "n:NT Authority\System";p:full"
2. Change registry settings related to Exclusive Mode:
$Registry_Key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\*\*\"
Get-ItemProperty -path $Registry_Key -name "{b3f8fa53-0004-438e-9003-51a46e139bfc},3" | % {Set-ItemProperty -path $_.PSPath -name "{b3f8fa53-0004-438e-9003-51a46e139bfc},3" -type Dword -value 0}
$Registry_Key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\*\*\"
Get-ItemProperty -path $Registry_Key -name "{b3f8fa53-0004-438e-9003-51a46e139bfc},4" | % {Set-ItemProperty -path $_.PSPath -name "{b3f8fa53-0004-438e-9003-51a46e139bfc},4" -type Dword -value 0}
A created two packages in SCCM (separately for each script) and ran them through Task Sequence.
Maybe that will be helpful for someone who struggle the same task and issue 🙂
Regards
Damian
- sebastiansieh-scJul 21, 2023Copper Contributor
Great job figuring that out. Window's propensity to alter this setting after updates is such a pain for my org.
I'm trying to run this and I'm not sure where SetACL.exe is coming from. It's not in my system32 folder.
Edit: found it. https://helgeklein.com/download/#