Getting user's domain name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott M. Lyon

    Getting user's domain name

    I'm having some strange problems with a VB.NET application that I support.


    The application currently uses SystemInformati on.UserName() and
    SystemInformati on.UserDomainNa me() to determine who is logged in, and what
    network domain they are logged into.


    And for our environment here (logged into a domain), it seems to work just
    fine.


    However, we have some German users (with a slightly different operating
    system - basic Windows XP english vs Windows XP german with something called
    the CAT client on it) that aren't getting the domain correctly, despite
    being logged into the same domain as we are in the states.


    When they run the application, it reports their domain as their computer
    name, and not the domain.


    I checked their system environment variables (manually, from a CMD window),
    and even that confirmed that they were on the domain. But it's still not
    reporting that to SystemInformati on.UserDomainNa me()


    I also tried the UserName/UserDomainName properties of the Environment
    object, and got the same (incorrect) results.


    Has anyone else dealt with anything like this? If so, what do I need to do
    to get the correct domain?


    Thanks!
    -Scott



  • M. Posseth

    #2
    RE: Getting user's domain name

    you might try

    System.Environm ent.UserDomainN ame

    regards

    m. posseth

    "Scott M. Lyon" wrote:
    [color=blue]
    > I'm having some strange problems with a VB.NET application that I support.
    >
    >
    > The application currently uses SystemInformati on.UserName() and
    > SystemInformati on.UserDomainNa me() to determine who is logged in, and what
    > network domain they are logged into.
    >
    >
    > And for our environment here (logged into a domain), it seems to work just
    > fine.
    >
    >
    > However, we have some German users (with a slightly different operating
    > system - basic Windows XP english vs Windows XP german with something called
    > the CAT client on it) that aren't getting the domain correctly, despite
    > being logged into the same domain as we are in the states.
    >
    >
    > When they run the application, it reports their domain as their computer
    > name, and not the domain.
    >
    >
    > I checked their system environment variables (manually, from a CMD window),
    > and even that confirmed that they were on the domain. But it's still not
    > reporting that to SystemInformati on.UserDomainNa me()
    >
    >
    > I also tried the UserName/UserDomainName properties of the Environment
    > object, and got the same (incorrect) results.
    >
    >
    > Has anyone else dealt with anything like this? If so, what do I need to do
    > to get the correct domain?
    >
    >
    > Thanks!
    > -Scott
    >
    >
    >
    >[/color]

    Comment

    • M. Posseth

      #3
      RE: Getting user's domain name

      you might try

      System.Environm ent.UserDomainN ame

      regards

      Michel Posseth

      "Scott M. Lyon" wrote:
      [color=blue]
      > I'm having some strange problems with a VB.NET application that I support.
      >
      >
      > The application currently uses SystemInformati on.UserName() and
      > SystemInformati on.UserDomainNa me() to determine who is logged in, and what
      > network domain they are logged into.
      >
      >
      > And for our environment here (logged into a domain), it seems to work just
      > fine.
      >
      >
      > However, we have some German users (with a slightly different operating
      > system - basic Windows XP english vs Windows XP german with something called
      > the CAT client on it) that aren't getting the domain correctly, despite
      > being logged into the same domain as we are in the states.
      >
      >
      > When they run the application, it reports their domain as their computer
      > name, and not the domain.
      >
      >
      > I checked their system environment variables (manually, from a CMD window),
      > and even that confirmed that they were on the domain. But it's still not
      > reporting that to SystemInformati on.UserDomainNa me()
      >
      >
      > I also tried the UserName/UserDomainName properties of the Environment
      > object, and got the same (incorrect) results.
      >
      >
      > Has anyone else dealt with anything like this? If so, what do I need to do
      > to get the correct domain?
      >
      >
      > Thanks!
      > -Scott
      >
      >
      >
      >[/color]

      Comment

      • Scott M. Lyon

        #4
        Re: Getting user's domain name

        Isn't that the same as Environment.Use rDomainName?

        I've tried Environment.Use rDomainName, and it's giving me the same results.


        -Scott

        "M. Posseth" <MPosseth@discu ssions.microsof t.com> wrote in message
        news:FB61C491-E21A-42E7-A431-92DEBC66D9F7@mi crosoft.com...[color=blue]
        > you might try
        >
        > System.Environm ent.UserDomainN ame
        >
        > regards
        >
        > Michel Posseth
        >
        > "Scott M. Lyon" wrote:
        >[color=green]
        >> I'm having some strange problems with a VB.NET application that I
        >> support.
        >>
        >>
        >> The application currently uses SystemInformati on.UserName() and
        >> SystemInformati on.UserDomainNa me() to determine who is logged in, and
        >> what
        >> network domain they are logged into.
        >>
        >>
        >> And for our environment here (logged into a domain), it seems to work
        >> just
        >> fine.
        >>
        >>
        >> However, we have some German users (with a slightly different operating
        >> system - basic Windows XP english vs Windows XP german with something
        >> called
        >> the CAT client on it) that aren't getting the domain correctly, despite
        >> being logged into the same domain as we are in the states.
        >>
        >>
        >> When they run the application, it reports their domain as their computer
        >> name, and not the domain.
        >>
        >>
        >> I checked their system environment variables (manually, from a CMD
        >> window),
        >> and even that confirmed that they were on the domain. But it's still not
        >> reporting that to SystemInformati on.UserDomainNa me()
        >>
        >>
        >> I also tried the UserName/UserDomainName properties of the Environment
        >> object, and got the same (incorrect) results.
        >>
        >>
        >> Has anyone else dealt with anything like this? If so, what do I need to
        >> do
        >> to get the correct domain?
        >>
        >>
        >> Thanks!
        >> -Scott
        >>
        >>
        >>
        >>[/color][/color]


        Comment

        • Scott M. Lyon

          #5
          Re: Getting user's domain name

          Disregard my previous response. I just tried
          System.Environm ent.UserDomainN ame, and it returned nothing (which is the
          same as System.Environm ent.UserName did as well).


          -Scott

          "M. Posseth" <MPosseth@discu ssions.microsof t.com> wrote in message
          news:FB61C491-E21A-42E7-A431-92DEBC66D9F7@mi crosoft.com...[color=blue]
          > you might try
          >
          > System.Environm ent.UserDomainN ame
          >
          > regards
          >
          > Michel Posseth
          >
          > "Scott M. Lyon" wrote:
          >[color=green]
          >> I'm having some strange problems with a VB.NET application that I
          >> support.
          >>
          >>
          >> The application currently uses SystemInformati on.UserName() and
          >> SystemInformati on.UserDomainNa me() to determine who is logged in, and
          >> what
          >> network domain they are logged into.
          >>
          >>
          >> And for our environment here (logged into a domain), it seems to work
          >> just
          >> fine.
          >>
          >>
          >> However, we have some German users (with a slightly different operating
          >> system - basic Windows XP english vs Windows XP german with something
          >> called
          >> the CAT client on it) that aren't getting the domain correctly, despite
          >> being logged into the same domain as we are in the states.
          >>
          >>
          >> When they run the application, it reports their domain as their computer
          >> name, and not the domain.
          >>
          >>
          >> I checked their system environment variables (manually, from a CMD
          >> window),
          >> and even that confirmed that they were on the domain. But it's still not
          >> reporting that to SystemInformati on.UserDomainNa me()
          >>
          >>
          >> I also tried the UserName/UserDomainName properties of the Environment
          >> object, and got the same (incorrect) results.
          >>
          >>
          >> Has anyone else dealt with anything like this? If so, what do I need to
          >> do
          >> to get the correct domain?
          >>
          >>
          >> Thanks!
          >> -Scott
          >>
          >>
          >>
          >>[/color][/color]


          Comment

          • Scott M. Lyon

            #6
            Re: Getting user's domain name

            Okay, now I feel like an idiot. Ignore my last response (where it was
            blank) - that was a coding issue.


            But, as I suspected initially, System.Environm ent.UserDomainN ame seems to be
            returning exactly the same as Environment.Use rDomainName.


            -Scott


            "M. Posseth" <MPosseth@discu ssions.microsof t.com> wrote in message
            news:FB61C491-E21A-42E7-A431-92DEBC66D9F7@mi crosoft.com...[color=blue]
            > you might try
            >
            > System.Environm ent.UserDomainN ame
            >
            > regards
            >
            > Michel Posseth
            >
            > "Scott M. Lyon" wrote:
            >[color=green]
            >> I'm having some strange problems with a VB.NET application that I
            >> support.
            >>
            >>
            >> The application currently uses SystemInformati on.UserName() and
            >> SystemInformati on.UserDomainNa me() to determine who is logged in, and
            >> what
            >> network domain they are logged into.
            >>
            >>
            >> And for our environment here (logged into a domain), it seems to work
            >> just
            >> fine.
            >>
            >>
            >> However, we have some German users (with a slightly different operating
            >> system - basic Windows XP english vs Windows XP german with something
            >> called
            >> the CAT client on it) that aren't getting the domain correctly, despite
            >> being logged into the same domain as we are in the states.
            >>
            >>
            >> When they run the application, it reports their domain as their computer
            >> name, and not the domain.
            >>
            >>
            >> I checked their system environment variables (manually, from a CMD
            >> window),
            >> and even that confirmed that they were on the domain. But it's still not
            >> reporting that to SystemInformati on.UserDomainNa me()
            >>
            >>
            >> I also tried the UserName/UserDomainName properties of the Environment
            >> object, and got the same (incorrect) results.
            >>
            >>
            >> Has anyone else dealt with anything like this? If so, what do I need to
            >> do
            >> to get the correct domain?
            >>
            >>
            >> Thanks!
            >> -Scott
            >>
            >>
            >>
            >>[/color][/color]


            Comment

            • M. Posseth

              #7
              Re: Getting user's domain name

              well i did not recognize the SystemInformati on.UserName()
              you mentioned


              however :-)




              see Richard`s solution

              regards

              Michel Posseth


              "Scott M. Lyon" wrote:
              [color=blue]
              > Isn't that the same as Environment.Use rDomainName?
              >
              > I've tried Environment.Use rDomainName, and it's giving me the same results.
              >
              >
              > -Scott
              >
              > "M. Posseth" <MPosseth@discu ssions.microsof t.com> wrote in message
              > news:FB61C491-E21A-42E7-A431-92DEBC66D9F7@mi crosoft.com...[color=green]
              > > you might try
              > >
              > > System.Environm ent.UserDomainN ame
              > >
              > > regards
              > >
              > > Michel Posseth
              > >
              > > "Scott M. Lyon" wrote:
              > >[color=darkred]
              > >> I'm having some strange problems with a VB.NET application that I
              > >> support.
              > >>
              > >>
              > >> The application currently uses SystemInformati on.UserName() and
              > >> SystemInformati on.UserDomainNa me() to determine who is logged in, and
              > >> what
              > >> network domain they are logged into.
              > >>
              > >>
              > >> And for our environment here (logged into a domain), it seems to work
              > >> just
              > >> fine.
              > >>
              > >>
              > >> However, we have some German users (with a slightly different operating
              > >> system - basic Windows XP english vs Windows XP german with something
              > >> called
              > >> the CAT client on it) that aren't getting the domain correctly, despite
              > >> being logged into the same domain as we are in the states.
              > >>
              > >>
              > >> When they run the application, it reports their domain as their computer
              > >> name, and not the domain.
              > >>
              > >>
              > >> I checked their system environment variables (manually, from a CMD
              > >> window),
              > >> and even that confirmed that they were on the domain. But it's still not
              > >> reporting that to SystemInformati on.UserDomainNa me()
              > >>
              > >>
              > >> I also tried the UserName/UserDomainName properties of the Environment
              > >> object, and got the same (incorrect) results.
              > >>
              > >>
              > >> Has anyone else dealt with anything like this? If so, what do I need to
              > >> do
              > >> to get the correct domain?
              > >>
              > >>
              > >> Thanks!
              > >> -Scott
              > >>
              > >>
              > >>
              > >>[/color][/color]
              >
              >
              >[/color]

              Comment

              Working...