euglug.org

[Eug-lug] Samba Hell

작성자

카테고리:



Ken BarberFri May 14 15:29:02 PDT 2004

On Friday 14 May 2004 11:06, Grigsby, Garl wrote:
> 	You ROCK! I was really begining to doubt my sanity. Now for
> the real question, do you, or your friend, know how to setup a
> default logon script for all users. Failing that any idea how
> to automate the pdbedit setup? I have found that I can specify
> the logon script using usermgr.exe and that seems to work, but
> I would like to be able to specify a default script for all
> users.

----------  Forwarded Message  ----------

Subject: RE: Followup question
Date: Friday 14 May 2004 12:59
From: "Peter Shearer" <shearerp at nwcc.edu>
To: "Ken Barber" <mountainman at peak.org>

Well, without going too deep into it, he should specify the -S
 <script path> on the command line with pdbedit.  Going through
 the users already there would involve some sort of a loop. 
 Possibly, something like this (not tested):

#!/bin/sh

LOGONSCRIPT="\\\\server\\share\\profile"

for line in `pdbedit -L`; do
   usr=`echo $line | cut -d ':' -f 1`
   pdbedit -r -u ${usr} -S ${LOGONSCRIPT}
done

...but, I haven't had time to test that, so I'm not sure if it
 will execute properly, though.  It assumes that pdbedit is in
 the path, and if samba was installed using an RPM, this should
 be correct.

--Peter
-- 
"No-one has ever called me a cool dude. I'm somewhere between geek 
and normal."
	-- Linus Torvalds