Warm tip: This article is reproduced from serverfault.com, please click

Bridge machine between two AD Domain Controllers

发布于 2020-12-04 19:11:32

I have two Active Directory domains, A and B.

I have a Windows Server ws1 and a windows server ws2, both of which act as domain controllers of their respective domains (A and B).

I have a third Windows server ws3 on which a Powershell script must be run periodically to perform reading operations on domain controller ws1 of A, processing the data obtained from ws1 of A, to perform writing operations on ws2 of B.

NB: Domain A and domain B do not have any type of Trust (not even one-way). They are two domains kept specially segregated. The ws3 machine has visibility towards these machines but it is not part of neither domain A nor domain B.

Is there an easy way to do it?

Questioner
jfranz
Viewed
1
LisaJ 2020-12-08 13:14:51

Depends on what you want to read -- file system or directory data.

File system: You can map a drive with "net use", process the data in the directory, then unmap the drive. You can supply a domain in the credentials -- e.g. net use x: \\ws1\share user:DomainA\user /pass:S0m3th1ng and, when done, net use x: /d to unmap. Then net use x: \\ws2\share user:DomainB\user /pass:S0m3th1ngE15e and net use x: /d ... I'd use a securestring to stash the password for a real implementation.

Directory Data: Most of the powrshell commands accept -server and -credential as options. As an example:

Get-ADGroupMember <groupname> -server ws1.example.com -credential (get-credential)