DirWiz Logo
Knowledgebase

Article Tags

Using findstr to locate text in your UnitySync config/log files

2018-12-19 11:17:16
Custom Mapping Javascript Perl System Requirements Troubleshooting UnitySync 

It is sometimes necessary to find text in a connection configuration or log file. Examples of this might be:

  • You want to identify all connections using a specific IP address
  • You want to identify all connections using a specific engine type (i.e., ODBC)
  • You want to identify all custom object map files that utilize scripting (searching for & char)
  • You want to determine if a specific attribute is mapped in any of your custom map files

There is no way to do this type of text search in the UntiySync User Interface (UI), and Windows Explorer doesn’t perform this task very well, either. We’ve outlined the exact steps, below, for using findstr to aid your search of text to accomplish the tasks above.

Using findstr to identify all connections using a specific IP/hostname:

  • Open CMD prompt.
  • CD into your \UnitySync-v2.x\connections directory.
  • Run findstr as shown below:

Note: In your UnitySync connection, the IP maybe an numerical IP or a hostname. You need to search for the text exactly as it is identified in the Configured Directories box on the UI Launch Page.

>>findstr using IP address:
findstr /S "127.0.0.1" config.txt

Sample Output:
DirA to DirB\config.txt:sourceip=127.0.0.1
DirB to DirA\config.txt:destip=127.0.0.1

>>findstr using hostname:
findstr /S "ServerX" config.txt

Sample Output:
DirA to DirB\config.txt:destip=ServerX DirB to DirA\config.txt:sourceip=ServerX

Using findstr to identify all connections using a specific Engine type (i.e. ODBC, activedir):

  • Open CMD prompt.
  • CD into your UnitySync-v2.4\Connections directory
  • Run findstr as shown below:

>>findstr for engine type
findstr /S "ODBC" config.txt

Sample Output:
DirC to DirD\config.txt:engine=odbc-ldap DirD to DirC\config.txt:engine=ldap-odbc

Using findstr to identify all custom object map files that utilize scripting

Any instance of & in a custom map file indicates the use of scripting.

  • Open CMD prompt.
  • CD into your \global\map\custom directory.
  • Run findstr as shown below:

>>findstr for scripting
findstr /S "&" *person.txt

Sample Output:
pullmap-person.txt:company#64=&DropDigits("^company^") &
pushmap-person.txt:displayname#256=&uc("~cn~") &

>>findstr to determine which connections use custom map files
findstr /S /i "map-person" config.txt

Sample Output:

Connection1\config.txt:map-person=MycustomMap-person.txt
Connection2\config.txt:map-person=
Connection3\config.txt:map-person=AnotherCustomMap-person.txt

(Note: The blank simply means the connection does not use a custom file.)

Using findstr to determine if a specific attribute exists in your custom object map files

  • Open CMD prompt.
  • CD into your \global\map\custom directory.
  • Run findstr as shown below:

>>findstr for scripting
\findstr /S "unicodepw" *person.txt

Sample Output:
createuser-person.txt:unicodepw=deFaultpw7

More tips on refining findstr results

Refer to this link for additional information on findstr syntax:
https://technet.microsoft.com/en-us/library/bb490907.aspx

Share this article: Twitter reddit