Closed drstonephd closed 5 years ago
We use domain trusts, so I can use my account to add machines to other domains.
I expect my domain account to be used to add the machine to the domain.
An attempt will me made to use an account of the same username in the domain joined to add the machine to the domain. This account might not exist.
Fortunately, the same object with the username and password also has the domain.
Current code:
$IdJoinDomainElement = $identificationElement.AppendChild($unattendXml.CreateElement('JoinDomain', 'urn:schemas-microsoft-com:unattend')) $Null = $IdJoinDomainElement.AppendChild($unattendXml.CreateTextNode($domain))
Proposed code:
$IdJoinDomainElement = $identificationElement.AppendChild($unattendXml.CreateElement('JoinDomain', 'urn:schemas-microsoft-com:unattend')) $Null = $IdJoinDomainElement.AppendChild($unattendXml.CreateTextNode($JoinAccount.GetNetworkCredential().Domain))
1. 2. 3. 4.
I've only tested in one domain and it's fine. I have not tried to join a machine to a different domain yet, but will eventually do so.
I see the update. Thanks.
We use domain trusts, so I can use my account to add machines to other domains.
Expected Behavior
I expect my domain account to be used to add the machine to the domain.
Current Behavior
An attempt will me made to use an account of the same username in the domain joined to add the machine to the domain. This account might not exist.
Possible Solution
Fortunately, the same object with the username and password also has the domain.
Current code:
Proposed code:
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context
I've only tested in one domain and it's fine. I have not tried to join a machine to a different domain yet, but will eventually do so.
Your Environment