joestramandinoli
asked on
Setting a time server via batch file
Hi All,
I need to be able to set a time server via batch file.
I have made a small script
net time \\192.168.0.23 /set /yes
However, when I try to run this on one of our store computers, it says that the access is denied.
How do I get this to run with the admin username and password?
Any help will be much appreciated.
Thanks
Joe
I need to be able to set a time server via batch file.
I have made a small script
net time \\192.168.0.23 /set /yes
However, when I try to run this on one of our store computers, it says that the access is denied.
How do I get this to run with the admin username and password?
Any help will be much appreciated.
Thanks
Joe
Does this machine is a part of domain environment? If so, you don't have to configure anything. Time services are issued to clients by PDC Emulatro master.
But if you wish to change anything with time services, you need to use for that w32tm command
More about this command at
http://technet.microsoft.com/en-us/library/cc773263%28WS.10%29.aspx#w2k3tr_times_tools_dyax
Regards,
Krzysztof
But if you wish to change anything with time services, you need to use for that w32tm command
More about this command at
http://technet.microsoft.com/en-us/library/cc773263%28WS.10%29.aspx#w2k3tr_times_tools_dyax
Regards,
Krzysztof
Ar ethe computers NOT on a windows Domain? Computers on the domain will automatically set time in sync with the domain contollers and in turn all DC's will sync with the DC that holds the PDC Emulator role.
just copy your command line into the logon script of users, never had problem doing that way unless your machine is not part of the domain.
Usually i use this syntax as first line of logon scripts :
net time \\ServerName /SET /Y
Usually i use this syntax as first line of logon scripts :
net time \\ServerName /SET /Y
you need to run it as an Admin from an Admin enabled command prompt -- if i recall you can't set a batch file to force Run As Admin from the compatibility tab.
for a non-domain system, you will find the Time server tab under Date & Time (3rd tab which you can specify a server -- default is TIME.MICROSOFT.COM
domain systems will take the NTP setting from the DHCP scope - Server Option 042
for a non-domain system, you will find the Time server tab under Date & Time (3rd tab which you can specify a server -- default is TIME.MICROSOFT.COM
domain systems will take the NTP setting from the DHCP scope - Server Option 042
ASKER
Hi,
Thanks for all the replies....
Our stores are in a private wan but are not on the domain so they can't authenticate using domain credentials so this script needs to run as the local admin on the machines.
Thanks
Joe
Thanks for all the replies....
Our stores are in a private wan but are not on the domain so they can't authenticate using domain credentials so this script needs to run as the local admin on the machines.
Thanks
Joe
ASKER
Anyone?
net localgroup administrators "domain\security groups" /add
This will add a security group from your domain to the local admins group for the desktop.
This will add a security group from your domain to the local admins group for the desktop.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, I will give that a shot
1. Run it as a scheduled task
2. Run it as a GPO (set a registry value)
See: http://support.microsoft.com/kb/223184