Task Sequence failed with the error code (0×80070002)
Smsts.log file from target machine showed following:
Network access account credentials not supplied
After that Task Sequence failed:
To resolve this issue, Network Access Acount has to be configured in SCCM 2012.
Click on Sites-> Right click on Distribution Point -> Click on Configure Site Components ->Software Distrubition.
Click on Network Access Account and specify account with natwork access location perimisions.