Tomasz Chmielewski
2004-Nov-04 14:34 UTC
[Samba] netlogon scripts for machines / groups - possible?
Hello, I use Samba 3 as a PDC. When a user logs in, a user-specific script is executed for him/her, as stated in smb.conf: logon script = %U.bat This is handy when it comes to do some minor tweaks, but can become pain when one have to do bigger changes. Is it possible to execute also a "machine script" (for installing software etc.), and "group script" (users belonging to a certain group should have specific settings applied)? I was thinking of something like: logon script = %U.bat - now it's executed for a user machine logon script = %m.bat group logon script = %g.bat etc. Tomek
Jason Balicki
2004-Nov-04 15:58 UTC
[Samba] netlogon scripts for machines / groups - possible?
Tomasz Chmielewski <> wrote:> Is it possible to execute also a "machine script" (for installing > software etc.), and "group script" (users belonging to a certain group > should have specific settings applied)? > > I was thinking of something like: > > logon script = %U.bat - now it's executed for a user > > machine logon script = %m.bat > > group logon script = %g.batHmmm. I don't know of any specific mechanisim to do this, but you might be able to do some of it with just the batch files. For example, in your %U.bat you could call another batch file with %COMPUTERNAME%.bat. I'm not sure how to solve the group problem, though. I'm not aware of a mechanisim to retrieve the users group from the command line. You may be able to do this by using visual basic logon scripts, but that's beyond my capabilities, sorry. HTH, --J(K)
Paul Gienger
2004-Nov-04 16:07 UTC
[Samba] netlogon scripts for machines / groups - possible?
> Is it possible to execute also a "machine script" (for installing > software etc.), and "group script" (users belonging to a certain group > should have specific settings applied)?You can dynamically generate the script on the server if you're crafty with the prelogon parameters. I attach one to the profile share (since the client hits that before netlogon) and generate the script based on the user's group membership as returned by the groups <username> command on the server side. You can find my posting on it in the archives. The machine part could probably be done as well under my setup, since all you're doing is passing parameters to a perl script. Actually installing software could be a little dicey however, since you have to worry about user permissions and such, but you can always check if the user has admin privileges with ifmember or something similar. And then there's 3rd party tools, which I won't comment on out of ignorance on their operation. -- -- Paul Gienger Office: 701-281-1884 Applied Engineering Inc. Systems Architect Fax: 701-281-1322 URL: www.ae-solutions.com mailto: pgienger@ae-solutions.com
Tomasz Chmielewski schrieb:> Hello, > > I use Samba 3 as a PDC. > > When a user logs in, a user-specific script is executed for him/her, as > stated in smb.conf: > > logon script = %U.bat > > > This is handy when it comes to do some minor tweaks, but can become pain > when one have to do bigger changes. > > Is it possible to execute also a "machine script" (for installing > software etc.), and "group script" (users belonging to a certain group > should have specific settings applied)? > > I was thinking of something like: > > logon script = %U.bat - now it's executed for a user > > machine logon script = %m.bat > > group logon script = %g.bat > > etc. > > > Tomekhi, you can user ifmember.exe with a default.bat for groups, and parse the host name in default bat to to do other stuff this runs very nice and will give you the features you desire Regards