Is there a way I can fix this error without re-adding the device to the domain

752 Views Asked by At

When running the command "Get-Appxpackage -AllUsers" it errors on about 3% of the devices I deploy it to. So far this is around 30 in 900. It does not error if you do not have "-Allusers" parameter present. I have included the error below. I am aware of the normal fixes for trust relationship errors and I have tried the following:

  • Resetting the local machine password as suggested when you search how to fix trust relationship error
  • Running Test-ComputerSecureChannel comes back true.
  • Running nltest /sc_verify:EXAMPLEDOMAIN shows the trust is verified.
  • I have tried running "Get-Appxpackage -User 'example.user'" and it does not serve the function I need.
  • I have tried wsreset.exe

The error message is not the standard workstation to primary domain message. It is the primary domain to the trusted domain. As far as I am aware this is normally only on servers that have this but this is showing on workstations. Please see the highlighted differences below.

Get-Appxpackage -AllUsers Get-Appxpackage : The trust relationship between the primary domain and the trusted domain failed. (Exception from HRESULT: 0x800706FC) At line:1 char:1

  • Get-Appxpackage -AllUsers
  •   + CategoryInfo          : NotSpecified: (:) [Get-AppxPackage], COMException
      + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackageCommand
    
    

If I remove and re-add the device to the domain it does fix the issue. However this is not practical. I would like to know what re-adding the device to domain is doing to fix this so that I can fix it remotely via script.

0

There are 0 best solutions below