/build/static/layout/Breadcrumb_cap_w.png

trust relationship between workstation and primary domain failed

Using a VB script from the Microsoft Hey Scripting Guy site to add a domain user to a local administrators group:

strComputer = "."
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://adminsys/XTeam-wksadm")
On Error Resume Next
Err.Clear
objGroup.Add(objUser.ADsPath)

Doing this in a Windows XP Service Pack 3 environment. It works some but not all the time. On occasion I get the message "The trust relationship between this workstation and the primary domain failed."

Reading about this error online, people have said they've removed the PC from the domain then rejoined the domain, and that solves the issue.

However, all I've had to do is reboot the PC and rerun the script and it works.

I'd like to build in some error handling to the script, but am not quite sure of the underlying cause for the error. At first I suspected the registry key HKLM\System\CurrentControlSet\Control\SessionManager\PendingFileRenameOperations, but that key has been populated with a value in only some of the instances.

So while a reboot solves the issue, I don't know WHY it solves the issue, and I'm not sure what I should add to my error handling code.

Has anyone else encountered this?

0 Comments   [ + ] Show comments

Answers (1)

Posted by: anonymous_9363 13 years ago
Red Belt
0
I suspect it's related to machine account password-aging.

If the machine and domain haven't "agreed" to a password change for the machine's account (this normally happens if a machine has been disconnected from the domain longer than the specified number of days), AD effectively removes that machine from the domain. You can interrogate that directly in AD: the account has a property 'pwdLastSet'.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ