Getting the Net Time on a Domain

Last reviewed: January 16, 1997
Article ID: Q98722
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.5, 3.51, 4.0
    

SUMMARY

When trying to execute

   net time /domain:egdomain /set

you may get a message saying the account is not known or the password is invalid. This can happen if you are logged on using an account whose name is spelled "Administrator", but the account is a different Administrator account than the one on the domain controller. For example, if you are logged on as EGMACHINE\Administrator, and attempt

   net time /domain:egdomain /set

you will get an error message because EGMACHINE\Administrator is not the same account as EGDOMAIN\Administrator.

The solution is to log off EGMACHINE, log back on as EGMACHINE\PowerUsr1, then execute the command. Note that a privilege is needed to set the time on a machine. In the previous example, the account, EGMACHINE\PowerUsr1, was used to remind us that power users have the needed privilege.

MORE INFORMATION

When running Windows NT while logged on to a domain, doing a NET TIME without the /DOMAIN parameter, as mentioned above, probably will not yield the desired results. However, because you are logged on to a domain, you can do

   net time /domain /set

and a domain controller from the domain you are logged on to will be used. In other words, if you are logged on to a domain, the /DOMAIN parameter is necessary, but the actual domain name can optionally be left to default to the domain you're currently participating in. If your machine is joined to the a domain, that domain will be the default domain for NET TIME /DOMAIN.

If you are trying to get the time from EGDOMAIN and have done a prior

   net use /user:username

where username can be either a legitimate user name or domain name\user name pair, or anything that will use the guest access), then the net time will use the existing connection to the IPC$ share, using the different user name.


KBCategory: kbprg
KBSubcategory: BseSecurity
Additional reference words: 3.50 3.51 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.