There are several situations where a secondary site may loss communication with one of his child distribution points randomly, while continue communicating OK with other DPs.
Even if we have connectivity, ping resolution and access to Admin$ with the machine account, the situation is not solved on its own, will need to restart the smsexecutive service to restore the communication and stop the errors on the logs.
Failed to make a network connection to \\Server\ADMIN$ (0x35).
Cannot establish connection to [“Display=\\Server\”]MSWNET:[“SMS_SITE=S01”]\\Server\. Error = 53
Copying D:\Foler\File to \\SERVER02\SMSPKGD$\FileFolder, Failed, Win32 Error = 64 SMS_DISTRIBUTION_MANAGER date 7:53:25 AM 74756 (0x12404)
On my environment this happen kind of frequently, and as the troubleshooting steps are always the same I created a script to automate the solution.
Please test before use extensively, this come with no guaranties so use on your own risk.
I added some controls on the script so the most impacting steps asks before run, if you delete this steps may automate the solution, if integrated with your monitoring tool may do your System Center Configuration Manager tech live more comfortable.
Here are the lines, just copy past on PowerShell and have fun:
#Script to repair the DPs connection events 53 and 64 on secondary site
#On ConfigMgr
#Created on 20 Oct 2016
#Created By Raul del Moral
#**************************************
# Version 2.0 adding the next features:
# Enable control on the script execution so ask for the restart on SmsExec service
# Enable logging on the server with the whole process
# Enable control on SmsExec service so if not detected stops
#**************************************
#Set the variables to use on the script
$DPName = Read-Host -Prompt ‘Enter the DP name’
if (!$DPName ) {Write-host -ForegroundColor Red -backgroundColor White “Please provide a DP name”
exit(1)}
$Admin = “$DPName\admin$”
$service = “SMS_EXECUTIVE”
#$Userlog = “$env:USERPROFILE\Desktop\DP_Repair.log” #If wants to have the logs on the Desktop session of server where the script is run
#$ServerLog= “\server\Unit$\path” #If wants to have the logs on the server where the script is run
$log = “C:\temp\testlog.txt” #To save the logs on the temp folder of the server where the script is run
$LogTime = Get-Date -Format “dd-MM-yyyy_hh:mm:ss”
$PatToCMTRACE = “C:\sccm\tools\CMTrace.exe” #Adapt to your server
$PathToDistmgr = “c:\SCCM\Logs\distmgr.log” #Adapt to your server
#Create the function to managed the input on the script
#Create Function for logging
Start-Transcript $Log -Append -NoClobber
Write-Host “###################################”
Write-Host “###################################”
Write-Host “$LogTime $env:computername $env:USERNAME”
Write-Host “###################################”
Write-Host “###################################”
#Create the function for ping confirmation on the remote DP
Function Ping_test (){
if(!(Test-Connection -Cn $DPName -BufferSize 16 -Count 1 -ea 0 -quiet))
{Write-Host “Cannot connect with server $DPName” -ForegroundColor Red -BackgroundColor white | Out-Default
Write-Host “$LogTime $env:computername $env:USERNAME” | Out-Default
}
Else {}#End If
}
#Create function to test Admin$
Function Test_Share (){
if(!(Test-Path \\$Admin -ea 0))
{Write-Host “Cannot connect with server share $Admin” -ForegroundColor Red -BackgroundColor white | Out-Default
Write-Host “$LogTime $env:computername $env:USERNAME” | Out-Default}
Else {}#End If
}
#Create function to stop the smsexec service
Function Stop_smsexec(){
Write-Host “Now will restart the service smsexe on server $env:computername” -ForegroundColor Yellow | Out-Default
Write-Host $LogTime | Out-Default
if((Get-Service $service -ErrorAction SilentlyContinue))
{(Stop-Service $service -Confirm -ErrorAction SilentlyContinue) #this will promt a confirmation before restart the service
}
Else {Write-Host “The machine $env:computername has no smsexec service running”
Write-Host “$LogTime $env:computername $env:USERNAME”
Exit 1
}#End If
}
#Timer for service stop, will wait to run the start command till the service is confirmed as stopped
Function Timer()
{
do { Start-Sleep -Milliseconds 200}
until ((get-service $service).status -eq ‘Stopped’)
}
#Create function to start the smsexec service
Function Start_smsexec(){
if(!(Start-Service $service -ea 0))
{Write-Host “SmsExec service started” -ForegroundColor Green -BackgroundColor white | Out-Default}
Write-Host “$LogTime $env:computername $env:USERNAME’r” | Out-Default
Else {
Write-Host “The SmsExec Service could not be started, will need to restart the machine” -ForegroundColor Red -BackgroundColor white | Out-Default
Write-Host “$LogTime $env:computername $env:USERNAME” | Out-Default
}#End If
}
#Execution of functions
Ping_test
Test_Share
Stop_smsexec
Timer
Start_smsexec
#Open the cmtrace to review the DP connection path to CMTrace tool and Path to the log to open
& “”$PathtoCMTRACE” ‘$PathToDistmgr'”
Stop-Transcript #Stop the logging
Enjoy it 🙂