Microsoft KB Archive/98722

{|
 * width="100%"|

INFO: Getting the Net Time on a Domain

 * }

Q98722

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * the operating system: Microsoft Windows NT, versions 3.5, 3.51, 4.0
 * the operating system: Microsoft Windows 2000

-

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 &quot;Administrator&quot;, 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/Windows 2000 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.

Additional query words: 3.50

Keywords : kbAPI kbDateTime kbKernBase kbOSWinNT350 kbOSWinNT351 kbOSWinNT400 kbOSWin2000 kbDSupport kbGrpDSKernBase

Issue type : kbinfo

Technology : kbAudDeveloper kbWin32sSearch kbWin32API