Get AD SiteName RRS feed

  • Question

  • Hi Folks,

    I need to run the code below in c# but I'm having a hard time.

    Set obj = CreateObject("ADSystemInfo")  
    MsgBox obj.SiteName 

    Do you guys have any ideas?
    I'm trying with System.DirectoryServices but didn't have much lucky. I don't even have a resonable code to share yet :)

    Thanks in advance,
    Monday, December 22, 2008 9:39 PM


  • That's VB6 code.  Yes, it won't work well when you try to compile it with the C# compiler.  Try the BCL forum for questions about the System.DirectoryServices namespace.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, December 29, 2008 12:37 PM
    Tuesday, December 23, 2008 1:37 AM