0x80070006: The handle is invalid
A program used a reference to a file, service or other resource that is no longer valid. In SCCM it often clears after a restart.
What 0x80070006 means
0x80070006 is the Windows code ERROR_INVALID_HANDLE, "The handle is invalid". In Configuration Manager you see it in the deployment status in the console, in Software Center, and in client logs such as AppEnforce.log and WUAHandler.log.
A handle is a reference that Windows gives a program for an open resource, such as a file, a registry key or a service. This error means the program used a handle that Windows does not accept. The resource was closed, or it was never opened correctly.
Common causes
- A service that the job needs stopped or restarted while the job ran.
- Security software closed or blocked a file or a process that the client used.
- An installer has a fault and returns this code as its exit code.
- The Windows Update Agent or the client is in a bad state after a failed update or an unfinished restart.
How to fix 0x80070006
-
Restart the computer and retry
Start with a restart. It closes every stale handle and finishes pending file operations. Then retry the deployment from Software Center, or run the matching evaluation cycle from Control Panel > Configuration Manager > Actions.
-
Find the job that failed
Open the logs in
C:\Windows\CCM\Logsand go to the time of the error. For an application, readAppEnforce.logand note the exit code and the command line. For a software update, readWUAHandler.log. The lines before the code say which resource the job used. -
Check the services the job needs
Run the code block below. The SMS Agent Host, Windows Update, Background Intelligent Transfer Service and Windows Management Instrumentation services must not be disabled. Check the System event log for a service that stopped at the time of the error.
-
Rule out security software
Read the log of your antivirus or endpoint protection product for the same time. Add the exclusions that Microsoft lists for Configuration Manager clients. Then retry.
-
Test the installer by hand
If one application always returns this code, run its install command by hand on a test computer. If it fails there too, the installer has the fault. Turn on the installer's own log and contact the vendor.
Commands that help
Get-Service -Name CcmExec, wuauserv, BITS, Winmgmt | Select-Object Name, Status, StartType
Turn any hex or decimal error code into its meaning, or search every code on this site.