Sorry, but why are you using psexec to import a registry at all? Just use reg import normally.
Changing reg key during SCCM TS- error 4634
I have spent a significant amount of days trying to get this working and cannot. I am trying to change a few reg keys at the end of a TS. Obviously, after the OS is installed.
Reg import and reg add do not work because of Access Denied in regedit errors. I am able to run psexec to make the change but it will not run during the TS, only after I login.
I am not looking to make these permanent changes through GPO, only looking for answers as to why it doesn't work in the TS.
I have a step that copies the PSTools to c:\, earlier in the TS. When it gets to the step to run the changes, it errors out with 4634 (which I can't find anywhere online). What is happening?
This is a sample of one command being run and again, if I login when the TS is done, I can run this in CMD with no issues:
C:\PSTools\psexec64 -d -i -s /accepteula reg add "HKLM\System\ControlSet001\Control\Power\User\PowerSchemes\8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c\2a737441-1930-4402-8d77-b2bebba308a3\48e6b7a6-50f5-4782-a5d4-53bb8f07e226" /f /v DCSettingIndex /t REG_DWORD /d 0
but it will absolutely not go during TS.
Process completed with exit code 4436 TSManager
Showing task sequence error message after failure in task sequence step of type 'SMS_TaskSequence_RunCommandLineAction' TSManager
Execution::enExecutionFail != m_eExecutionResult, HRESULT=80004005 (X:\bt\1022896\repo\src\client\TaskSequence\TSManager\tsmanager.cpp,1293)
Task sequence execution failed with error code 80004005
Can anyone explain why this doesn't work or another solution to make a reg key addition/change that bypasses permissions?
And to clarify, I have also tried running it as local admin and as a SMSTSPostAction Variable.
Sign in to comment
Sort by: Most helpful
As I said, reg import does not work. Access Denied on the specific reg key
Apologies, I see now that you mentioned this already. However, I use reg import in TS all the time so know for sure it works. You can try creating a cmd file and call it under a package. Also, are you trying to set a high performance power plan? Did you try using
Sign in to comment
I'm not trying to set high performance, that would be significantly easier.
I'm aware that reg import works for most other keys/values but it does not work for this specific instance so I'm trying to figure out why.
I've already tried as a package, script, batch, CMD, PS, inside and outside of SMSPostAction, with specifying a local admin and with it running as system.
Either they run but don't apply or like I said above, it gives me this errors. I cannot find any information on those errors, that's what I'm trying to figure out
Assuming you are trying to activate a specific power plan, have you tried using the Activate method of the Win32_PowerPlan WMI class? Reference: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/powerwmiprov/activate-win32-powerplan.
Alternatively, as @Rahul Jindal [MVP] called out, the /SETDCVALUEINDEX option for powercfg.exe will accomplish this also as powercfg is for much more than simply selecting a default/built-in power scheme.
I'm not trying to activate a specific power plan, I'm trying to change the USB selective suspend setting within the power plan
That's not what the DCSettingIndex registry value does though to my knowledge (although I could be wrong as these registry values are undocumented to my knowledge).
Have you tried the import and export options of powercfg?
Yes. I can easily make the changes needed via all of these methods, once logged in after the TS runs, I just can't get the changes to stick during and after the TS on its own. So I know these things change what I need it to change.
I've resigned to just creating the GPO and I'll change it every time it needs to be updated.
Sign in to comment