DirWiz Logo
Knowledgebase

Article Tags

Refining findstr search results

2018-12-19 11:17:55
Custom Mapping Errors Exclusions Javascript LDIF Troubleshooting UnitySync 

When you have a lot of connections, it may be difficult to remember the exact configuration of each and/or compare their settings if necessary. (Without flipping between the connections in the UI).

The connection config data is in config.txt of each connection. Consider using findstr to search/output configuration data from a CMD prompt.

Start > CMD Prompt
C:\
CD \UnitySync\Connections

As an example, if you want to output the sync container Placement DN (aka destsubtree) you’d run similar to:

Example findstr on all connections' config.txt

run findstr /S "destsubtree=" config.txt >AllDestsubTree.txt

/S will search ALL config.txt files in subdirectories
/i can be used if you aren’t sure of the case
Output includes the file name and the line where the string was found.

Sample output in AllDestsubTree.txt

AD1 to AD2\config.txt:destsubtree=ou=AD1Contacts,ou=ExternalGal,dc=Domain2,dc=com
AD3 to AD2\config.txt:destsubtree=ou=AD3Contacts,ou=ExternalGal,dc=Domain2,dc=com
AD1 to AD3\config.txt:destsubtree=ou=AD1Contacts,ou=Outside Contacts,dc=Domain3,dc=com 

You could then further refine the data to search for specific destinations by doing a findstr on AllDestsubTree.txt (no /S needed, it’s just one file)

Example findstr on single file:

run findstr /i "dc=domain2" AllDestsubTree.txt > Domain2.txt

Sample output in Domain2.txt
AD1 to AD2\config.txt:destsubtree=ou=AD1Contacts,ou=ExternalGal,dc=Domain2,dc=com AD3 to AD2\config.txt:destsubtree=ou=AD3Contacts,ou=ExternalGal,dc=Domain2,dc=com

Similar search strings can be used to search map files, logs, etc.

cd \UnitySync\global\map\custom
findstr /i "description="

cd \UnitySync\connections\AD1 to AD2\Logs
findstr /i "Run Time" *sync.txt
Share this article: LinkedIn Twitter reddit