Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: 19 Oct 2005 17:23:27 -0700,    group: microsoft.public.platformsdk.active.directory        back       


Error using NameTranslate to convert SID to DN   
Greetings,

I have been using the following VBscript code to translate SIDs to LDAP
DNs for my main AD domain with no issues.  Recently we have created a
new tree
in our forest and the objTranslate.Set call fails with:
 "Could not find the name or insufficient right to see name."

The objTranslate.Set call fails even when logged in as a Domain and/or
Enterprise
Admins.

The existing domain started life as a Win2k mixed mode and has since
been upgraded & converted to Win2003 native.  The new domain has been
created from scratch as Win2003 AD (1st change was to make it native).

Obviously it is something different between the two domains, but where
do I start looking???

Thanks in advance!

'-------------------------------------------
Set objTranslate = CreateObject("NameTranslate")
objTranslate.Init ADS_NAME_INITTYPE_DOMAIN, strDomainName

objTranslate.Set ADS_NAME_TYPE_NT4, strDomainName & "\" & strUserName
strUserDN = objTranslate.Get(ADS_NAME_TYPE_1779)
Set objUser = GetObject("LDAP://" & strUserDN)

objUser.GetInfoEx Array("tokenGroups"), 0
arrTokenGroups = objUser.Get("tokenGroups")

For intCounter = LBound(arrTokenGroups) To UBound(arrTokenGroups)
  strSid =
ConvertHexStringToSidString(ConvertByteArrayToHexString(arrTokenGroups(intCounter)))

  objTranslate.Set ADS_NAME_TYPE_SID_OR_SID_HISTORY_NAME, strSid
  strUserDN = objTranslate.Get(ADS_NAME_TYPE_1779)

  WScript.Echo "SID: " & strSid
  WScript.Echo "DN: " & strUserDN
Next
'-------------------------------------------
date: 19 Oct 2005 17:23:27 -0700   author:   Froosh

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us