Page 1 of 1 1
Topic Options
#41299 - 2003-06-10 02:20 AM SU command
Bob Deerinwater Offline
Starting to like KiXtart

Registered: 2002-05-05
Posts: 101
Loc: Covina California
I undesrstand that this topic has been beaten to a pulp. But i have questions that i can not seem to figure out. I know that what i need to do can be accomplished by task scheduler. But unfortunately not all machine are up to date on the serveice packs or internet explorer. I do have su install on all workstations. I am trying to use the su command to add domain users to change time. that will be my start out point but later on i would like to install wmi and other things with su in the logon script. here is the bat file that will be called or implemented direclty into the script. The funny thing is the quotes in fron of ntrights if it is not their does not worl even if i close the quotes it does not work
code:
echo password | su username "ntrights -u "domain users" +r SeSystemtimePrivilege cvhp -m %computername%


Top
#41300 - 2003-06-10 11:48 PM Re: SU command
Bob Deerinwater Offline
Starting to like KiXtart

Registered: 2002-05-05
Posts: 101
Loc: Covina California
Any one have a suggestion and i have read the forums and many other places
Top
#41301 - 2003-06-11 12:13 AM Re: SU command
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Try this

code:
  
echo password | su username 'ntrights -u "domain users" +r SeSystemtimePrivilege cvhp -m %computername%'

I am using su for changing registry key permission see my code (batch file)

code:
 
echo password|su username -w "\\server\share$\regini \\server\share$\reg.txt" -dn -l

This is working fine, I convert this batch file as com and Shell it out threw kix
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#41302 - 2003-06-11 04:16 AM Re: SU command
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rather than giving users the right to change the system time, it would be better to put the energy into setting up the Windows Time Service to do it automatically. In fact, on an AD network, that is the only way that time should be managed.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#41303 - 2003-06-11 05:43 AM Re: SU command
Bob Deerinwater Offline
Starting to like KiXtart

Registered: 2002-05-05
Posts: 101
Loc: Covina California
Unfortunateley, the company i work for does not show any interest in going into active directory so that path is out. I will look into the Windows Time Service that sounds like a more stable way of doing it if you have any references i would like to see them
Top
#41304 - 2003-06-11 05:46 AM Re: SU command
Bob Deerinwater Offline
Starting to like KiXtart

Registered: 2002-05-05
Posts: 101
Loc: Covina California
I guees i should have said that i have a mixed number of operating systems of which 25% are 2000 and the rest NT and 9x
Top
#41305 - 2003-06-11 01:57 PM Re: SU command
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The Windows Time Service works with NT4/2K/XP, exactly where the permissions would need to be changed using SU. Wintendos are not really an issue and can be dealt with using an @InWin macro.

If you search this board or TechNet on "W32Time", you should find all you need to know to setup the time service.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#41306 - 2003-06-11 07:52 PM Re: SU command
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Bob
I am also trying to find out a solution for this issue I dont wana use SU for this.

If you find out any thing please do post here.

Thanx.
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#41307 - 2003-06-11 11:55 PM Re: SU command
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Hmmm,

just thinking aloud here... Some of the COM dudes may gave you an example.

- Install the W32time service in your domain (documentation somewhere on M$ site)
- use createobject with WinNT etc. to enumerate all NT and up machines (there is a UDF for this)
- Install W32time client to those machines (copying files and starting / installing services with XNET.exe)

then on login script only a settime for wintendos has to be done...

HTH

[ 11. June 2003, 23:56: Message edited by: MightyR1 ]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#41308 - 2003-06-12 08:27 PM Re: SU command
Bob Deerinwater Offline
Starting to like KiXtart

Registered: 2002-05-05
Posts: 101
Loc: Covina California
After doing dsome more investigation on this site i sound a nice little bit of code that did this for me. I also used the netdom.exe to get a listing of the workstations. used excel the edit the txt file to just the pc name. i used netdom > wksta.txt. imported it into excel as a space seperated file. cleared out the info that i dod not need. the txt file only needs the pc name \\wksta. copied into the root of c
and copied ntrights in to %compsec% ran the script from my workstation with admin rights and done. Whoever wrote this little bit of code..Thank YOU
code:
Break ON CLS
$FL = "c:\wksta.txt"
If Open(1,$FL,2) <> 0
? '@SERROR opening $FL'
? 'You must provide a list of target computers for this script to work.'
EndIf
$PC = ReadLine(1)
Do
? "[ Adding right to $PC ]"
Shell '%COMSPEC% /C ntrights -u "Domain Users" -m $PC +r SeSystemTimePrivilege >> C:\log.txt'
$PC = ReadLine(1)
Until @ERROR <> 0
$RC = Close(1)
? 'Check [ C:\log.txt ] for errors.'
Get $X
Quit


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.06 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org