Originally Posted By: Allen
- Missing $ in front of Servername, 2 places
- $ReadNC="" is doing nothing. The function name (ReadNC) is automatically dimmed, and each time the function is called redimmed.
- Dim all other vars not in your function line.

 Code:
Function ReadNC($ServerName)
  Dim $Root
  $Root = GetObject( "LDAP://" + $ServerName + "/rootDSE" )
  If @ERROR = 0
     $ReadNC = $Root.defaultNamingContext
  Endif
EndFunction

Ok. I'm not getting an error now, but the message box is blank. Also, I took the ReadNC function straight out of the manual in the FUNCTION section. Are the examples in the manual not reliable to use?