Deployment of a Command line?

Duchemin, Dominique 2,006 Reputation points
2022-09-30T03:13:14.987+00:00

Hello,

I am trying to

Disable the feature BranchCache (PeerDist)
Disable and Stop the service associated witn: PeerDistSvc

I create a bat file

BranchCache.bat

Dism /online /Disable-Feature /FeatureName:peerdist /NoRestart
sc config "PeerDistSvc" start= disabled
sc stop "PeerDistSvc"

I created a package and distributed it to a collection
246304-2022-09-29-18-55-52-script-branch-01.png

246335-2022-09-29-20-20-26-script-branch-03.png

but the distribution error out:
246229-2022-09-29-18-53-03-script-disable-branch-cache-mo.png

On the client I have the execmgr.log:

Executing program as a script execmgr 9/29/2022 7:51:13 PM 6644 (0x19F4)
Invalid executable file BranchCache.bat execmgr 9/29/2022 7:51:13 PM 6644 (0x19F4)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramBadEnvironmentEvent
{
AdvertisementId = "UCP208A0";
ClientID = "GUID:E90067B0-94BB-4AC9-982F-5ACE61FB41DC";
CommandLine = "BranchCache.bat";
DateTime = "20220930025113.003000+000";
DriveLetter = "";
MachineName = "VIPSCCMDP02";
PackageName = "UCP00DA9";
ProcessID = 6420;
ProgramName = "ISS - Servers - Disabling the service Branch Cache";
SiteCode = "UCP";
ThreadID = 6644;
Win32ErrorCode = 2147942402;
WorkingDirectory = "";
};
execmgr 9/29/2022 7:51:13 PM 6644 (0x19F4)
Raised Program Bad Environment Event for Ad:UCP208A0, Package:UCP00DA9, Program: ISS - Servers - Disabling the service Branch Cache execmgr 9/29/2022 7:51:13 PM 6644 (0x19F4)
EnterRsRuningState failed to run script BranchCache.bat 0x87d01106 execmgr 9/29/2022 7:51:13 PM 6644 (0x19F4)
Fatal error 0x87d01106 enountered for program ISS - Servers - Disabling the service Branch Cache. This program will not retry. execmgr 9/29/2022 7:51:13 PM 6644 (0x19F4)

=================================================================

second run changing the path to \ServerName\SCCm\Scripts
..............................................................................................................................
Checking UNC path \VRPSCCMPR01\SCCM\scripts for access execmgr 9/29/2022 9:00:52 PM 4720 (0x1270)
IsNetResourceAccessible failed with error code 0x00000003 execmgr 9/29/2022 9:00:52 PM 4720 (0x1270)

================================================================

Then trying \ServerName\sms_ucp\scripts
.........................................................................................
Checking UNC path \VRPSCCMPR01\sms_ucp\scripts for access execmgr 9/29/2022 9:14:22 PM 4720 (0x1270)
IsNetResourceAccessible failed with error code 0x00000005 execmgr 9/29/2022 9:14:22 PM 4720 (0x1270)

Checking this new error...

Thanks,
Dom

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
Microsoft Configuration Manager Updates
Microsoft Configuration Manager Updates
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Updates: Broadly released fixes addressing specific issue(s) or related bug(s). Updates may also include new or modified features (i.e. changing default behavior).
967 questions
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Duchemin, Dominique 2,006 Reputation points
    2022-10-02T02:56:14.913+00:00

    Hello,

    I tried the same PowerShell in PowerShell comand locally on a machine:
    246721-2022-10-01-19-53-57-script-ps-3-steps.png

    It has 3 steps but only the last one is executed, why?

    I added a separator at the end of each command line ";" semi-colon and apparently it is working I will restart the deployment...

    Stop the BranchCache Service

    sc stop "PeerDistSvc"

    stop-service PeerDistSvc;

    Disable the BranchCach Service

    sc config "PeerDistSvc" start=disabled

    Set-Service -Name PeerDistSvc -StartupType disabled;

    Disable the BranchCache feature

    Dism /online /Disable-Feature /FeatureName:peerdist /NoRestart;

    Thanks,
    Dom

    0 comments No comments

  2. Duchemin, Dominique 2,006 Reputation points
    2022-10-02T18:35:40.473+00:00

    Yes apparently I needed to add a separator ";" semicolon after each of the commands to get all of them working...

    Still testing for more results.

    Thanks,
    Dom


  3. Duchemin, Dominique 2,006 Reputation points
    2022-10-04T02:51:04.703+00:00

    Closing this thread as the target now is on a Cmd file containing the PowerShell command

    https://learn.microsoft.com/en-us/answers/questions/1033860/deployment-by-script-or-package.html

    Thanks,
    Dom

    0 comments No comments