Solved

LDAP query across forests

Posted on 2013-12-04
1
29 Views
Last Modified: 2015-05-11
I have two domain forests.  Let's call the 1st mydomain.com and 2nd is otherdomain.com.

I have a script that creates new user accounts, including the SamID from an input file called newusers.csv.  There's already a query to check for duplicate SamID's in mydomain.com, if a match is found the script exits with an a message of 'Duplicate SamID' found'.

I need a script to query for duplicate SamID's in otherdomain.com.  There is a two-way trust between the forests.
0
Comment
Question by:BigmacMc
1 Comment
 

Accepted Solution

by:
BigmacMc earned 0 total points
ID: 39696566
I believe I've answered my own question with the following:

for /f "skip=1 tokens=1,5 delims=," %%a in (%APPDIR%\CreateACcounts.csv) do dsquery user -domain otherdomain.com -samid %%b >>%APPDIR%\UserObjects.txt
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you have users whose passwords are expiring and they are constantly calling you?  Well I sure did and needed a way to put an end to this.  We have a lot of remote users which would not be notified that their passwords were expiring since they wer…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question