Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect and fix trust relationship issue automatically #99

Open
JonathanPitre opened this issue May 9, 2019 · 0 comments

Comments

Projects
2 participants
@JonathanPitre
Copy link
Collaborator

commented May 9, 2019

It,s quite common with master images to get trust relationship issues when they get disconnected from the domain for too long for instance. We could detect the event log that indicate that there is a trust relationship issue and run the appropriate powershell commands to fix it automatically.

https://theitbros.com/fix-trust-relationship-failed-without-domain-rejoining/

Reset-ComputerMachinePassword -Server $env:logonserver -Credential $env:USERDOMAIN$env:USERNAME
Test-ComputerSecureChannel -Repair -Credential $env:USERDOMAIN$env:USERNAME
nltest /sc_verify:corp.contoso.com

How to detect the event log id:

(Get-EvenLog -LogName System -after ((Get-Date).AddDays(-1))).Where{$.InstanceID -eq "5723 -Or $.InstanceID -eq "5721"

https://devblogs.microsoft.com/scripting/event-log-queries-using-powershell/
https://www.itprotoday.com/windows-8/powershell-event-id-searching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.