I am having to use nametranslate to transform a displayname and output samaccountname in active directory.
My issue is that the environment has a trust with other forests/domains so when i search for a displayName, it finds more than one instance and nametranslate fails.
Is there any way to force nametranslate to ONLY search one domain? I tried this:
This still finds the result from the other forest and dies. Any idea how to get around this and only search one domain?
My issue is that the environment has a trust with other forests/domains so when i search for a displayName, it finds more than one instance and nametranslate fails.
Is there any way to force nametranslate to ONLY search one domain? I tried this:
Code:
Set objTrans = CreateObject("NameTranslate")
objTrans.Init ADS_NAME_INITTYPE_GC, "domain.com"
objTrans.Set ADS_NAME_TYPE_DISPLAY, person
strUserName = objTrans.Get(ADS_NAME_TYPE_NT4)
This still finds the result from the other forest and dies. Any idea how to get around this and only search one domain?