Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Setting a time server via batch file

Posted on 2011-09-26
10
Medium Priority
?
1,780 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:joestramandinoli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 6

Expert Comment

by:Reubenwelsh
ID: 36597510
Hi, You have wto options really unless you want to go the ugly way of baking in admin passwords in items.

1. Run it as a scheduled task
2. Run it as a GPO (set a registry value)

See: http://support.microsoft.com/kb/223184



0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 36597516
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
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 36597526
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:Daelt
ID: 36597722
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

0
 
LVL 20

Expert Comment

by:Iain MacMillan
ID: 36598555
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
0
 

Author Comment

by:joestramandinoli
ID: 36598725
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
0
 

Author Comment

by:joestramandinoli
ID: 36813063
Anyone?
0
 
LVL 8

Expert Comment

by:PeteEngineer
ID: 36813137
net localgroup administrators "domain\security groups" /add
This will add a security group from your domain to the local admins group for the desktop.
0
 
LVL 4

Accepted Solution

by:
Daelt earned 2000 total points
ID: 36813298
sometimes things are much easier and we "informaticians" like to make complicated things for not much.

Want to run your script as local admin?

Just set up a schedule task, in first tab, setup the local admin account, in the trigger tab (2nd tab), click new (at bottom) then select "at start up" in the menu. 3rd tab (Action), select "start a program" then browse to your script and select it. Click ok

Now your script will run with local admin rights each time you start up the machine.
0
 

Author Comment

by:joestramandinoli
ID: 36928874
Thanks, I will give that a shot
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question