errors applications like pshell-batchfile

corne nietnodig 196 Reputation points
2022-06-15T14:08:16.773+00:00

211707-failed-vfiles.png![211695-error-3-smstslog.png][3]I already have some other problems in this forum posted but this is not due to domain registration (i think), thats why a new ticket.

In the tasks sequence to deploy a image to clients there are errors for some powershell files and batchfiles which are started in the Task sequence. I have tried to put them together with the install applications step but also in the state restore steps at the end of the task sequence of MDT.
The erros which i get are in the attachements. It looks like MDT when deploying cannot reach the share which are in the powershell command and the batchfile. In both files i do a copy from a share on the network to the local client. If the local folder does not excists it is created in Powershell. The powershell command is a ps1 file which is added as a add powershell script and executed from %scriptroot%

The user which i use for deployment (is domain user) has enough rights to the share so that is not the problem.
I also do not know in which stage the task sequence is joining the domain because i have edited the 2 lines in ztidomainjoin according to some writing on google thats best for domain joining. The system is joined to the domain but not in the step (added extra step between post update in custom tasks: DOMAINJOIN-csript.exe "%SCRIPTROOT%\ztidomainjoin.wsf"

How ever this step also fails in the smsts.log, but the system is joined to the domain when deploying is ready. After a restart when client is finished the last command in de state restore step is ececuted which is also a application.

1: /api/attachments/211707-failed-vfiles.png?platform=QnA [3]: /api/attachments/211695-error-3-smstslog.png?platform=QnA
211628-vfiles-error2.png

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
937 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Simon Ren-MSFT 38,751 Reputation points Microsoft Vendor
    2022-06-16T07:38:47.717+00:00

    Hi,

    Based on my experience, you may put the batch script in a location that doesn't match in you command line. Put the batch script in the Scripts folder of your deployment share; the location will be %SCRIPTROOT% and you'll run something like cmd.exe /c %SCRIPTROOT%\install.bat. If you want to use a different folder in the deployment share, just remember the variable %DEPLOYROOT% points to the root of your share. You could run it from %DEPLOYROOT%\Custom\install.bat, for example, where Custom is a folder you've created in the deployment share.

    MDT Batch Files
    Note: The non-Microsoft link is just for your reference.

    Thanks for your time.

    Best regards,
    Simon


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. corne nietnodig 196 Reputation points
    2022-06-22T09:52:24.057+00:00

    Simon,

    Now it is working fine that is: alle applications and commands getting installed and run.
    The problem is when the computer is joined to the domain and it already excists in the domain and when i put machineobjectOU in the customsettings.ini.

    So now i have to delete the computer manually in AD and remove the lines machineobjectOU out of customsettings.ini then the deployment runs fine.

    Unfortunally this takes manual work before and after eacht image. Before: delete computer in domain and after move the computer from the computers OU to the right OU.

    Do you have any suggestions?

    0 comments No comments

  3. Simon Ren-MSFT 38,751 Reputation points Microsoft Vendor
    2022-06-27T09:26:00.817+00:00

    Hi,

    Thanks for your reply and feedback.

    Glad to know the application works well now.

    For the new scenario, we can try to use PowerShell script to remove the computer from the domain, and then join to domain and move to the correct OU. For more detailed information, please refer to:
    Remove computer from domain with MDT task sequence
    Moving Computers in Active Directory during MDT Deployments – Step by Step

    If the response is helpful, it's appreciated that you could click "Accept Answer" and upvote it, this will help other users to search for useful information more quickly.

    Best regards,
    Simon


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.