Re: [Samba] Running a login script

2008-03-19 Thread Jean-Jacques Moulis
On Tue, 18 Mar 2008 11:46:58 + (GMT) Mike Stewart <[EMAIL PROTECTED]> wrote:

MS> Hello all, 

MS> We are trying to find a way to run login scripts for our users but all the 
How-To files seem rather complicated :-( 

MS> We have been using Samba for several years and all our users have Windows 
2000 PCs, Samba accounts etc. They log into their Windows with a 
username/password OK. The Samba server is set up with the same 
username/password combination as their PCs so they don't have to supply 
username/password again and drive mappings are saved by Windows. A very simple 
system which has proved easy to maintain. 

MS> We are trying now to introduce "Generic" PCs which any user can access (hot 
desking I think it is called). So, we want the Samba server to prompt the user 
for a username/password combination when they click on the desktop shortcut to 
the server (we've accomplished that part easily) and then automatically run a 
login script to map their drives - that's the part we are struggling to find a 
solution to. 

MS> All the examples we've found so far refer to "Domain Controllers" - Do we 
have to set up the server as a Domain controller, do we have to create machines 
accounts etc ? 

A domain controller would be my prefered solution.
But you can use login scripts without.

Run gpedit.msc on  computers needing the login script.
Local computer policy --> user configuration --> windows settings --> scripts 
--> logon --> add
define the location of your script.

Regards!

-- 
Jean-Jacques   Moulis  Tel:  (013) 281684
ISYFax:  (013) 139282
Linköping UniversityE-mail: [EMAIL PROTECTED]
581 83 Linköping
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Running a login script

2008-03-19 Thread Mike Stewart
Hi JJ, thanks for the response.

Does this mean we create and store a script on the Windows PC ?  

We actually want to automatically run a script which resides on the Samba 
server - once the user has logged in we want to automatically to map drives etc.

Regards

Mike

- Original Message -
From: "Jean-Jacques Moulis" <[EMAIL PROTECTED]>
To: "Mike Stewart" <[EMAIL PROTECTED]>, samba@lists.samba.org
Sent: 19 March 2008 07:06:32 o'clock (GMT) Europe/London
Subject: Re: [Samba] Running a login script

On Tue, 18 Mar 2008 11:46:58 + (GMT) Mike Stewart <[EMAIL PROTECTED]> wrote:

MS> Hello all, 

MS> We are trying to find a way to run login scripts for our users but all the 
How-To files seem rather complicated :-( 

MS> We have been using Samba for several years and all our users have Windows 
2000 PCs, Samba accounts etc. They log into their Windows with a 
username/password OK. The Samba server is set up with the same 
username/password combination as their PCs so they don't have to supply 
username/password again and drive mappings are saved by Windows. A very simple 
system which has proved easy to maintain. 

MS> We are trying now to introduce "Generic" PCs which any user can access (hot 
desking I think it is called). So, we want the Samba server to prompt the user 
for a username/password combination when they click on the desktop shortcut to 
the server (we've accomplished that part easily) and then automatically run a 
login script to map their drives - that's the part we are struggling to find a 
solution to. 

MS> All the examples we've found so far refer to "Domain Controllers" - Do we 
have to set up the server as a Domain controller, do we have to create machines 
accounts etc ? 

A domain controller would be my prefered solution.
But you can use login scripts without.

Run gpedit.msc on  computers needing the login script.
Local computer policy --> user configuration --> windows settings --> scripts 
--> logon --> add
define the location of your script.

Regards!

-- 
Jean-Jacques   Moulis  Tel:  (013) 281684
ISYFax:  (013) 139282
Linköping UniversityE-mail: [EMAIL PROTECTED]
581 83 Linköping


-

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


RE: [Samba] Running a login script

2008-03-19 Thread Dennis McLeod
You can run it from anywhere, BUT, you'd have to have the drive mapped first
if it's on a network share.
You MAY be able to do a //server/share/logonscript.bat (I flipped the
slashes on purpose...), but I haven't tried that.

I copy a simple script (I have THAT as part of my logon script, too. Copy a
new one if it's different. Robocopy) to the local machine, and that one
launches the logon script from the server.

My local script looks like:
@echo off
net use q: \\server\login SECRETPASSWORD /user:login /persistent:no > NUL
CALL q:\logon.bat > NUL


Then my REAL logon script is the q:\logon.bat

I used gpedit to point the machine at the local batch file.


I have a registry string (For XP) to make the gpedit part easy:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts]

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
]

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
\0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\User"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
\0\0]
"Script"="logoff.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logon]

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logon\
0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\User"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logon\
0\0]
"Script"="logonscript.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00


Save that as a .reg file, and you can double click it to merge the file.
(Notice there is a logoff script in there too..)

I put THAT in my (server) logon script too, and ran the logon script the
first time remotely, with psexec:

"C:\Documents and Settings\Admin\Desktop\PsTools\psexec.exe" @machines.txt
-u administrator -p SECRETPASSWORD -c logon.bat >> c:\psexec\results.txt

The machines.txt file is the list of machines I want it to run on.
You must know the (or another account with admin privileges) administrator
account password....
Hope that helps...

I tested this manually on a few machines first, before I ran it on the
rest..

Dennis




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mike Stewart
Sent: Wednesday, March 19, 2008 3:02 AM
To: Jean-Jacques Moulis
Cc: samba@lists.samba.org
Subject: Re: [Samba] Running a login script

Hi JJ, thanks for the response.

Does this mean we create and store a script on the Windows PC ?  

We actually want to automatically run a script which resides on the Samba
server - once the user has logged in we want to automatically to map drives
etc.

Regards

Mike

- Original Message -
From: "Jean-Jacques Moulis" <[EMAIL PROTECTED]>
To: "Mike Stewart" <[EMAIL PROTECTED]>, samba@lists.samba.org
Sent: 19 March 2008 07:06:32 o'clock (GMT) Europe/London
Subject: Re: [Samba] Running a login script

On Tue, 18 Mar 2008 11:46:58 + (GMT) Mike Stewart
<[EMAIL PROTECTED]> wrote:

MS> Hello all,

MS> We are trying to find a way to run login scripts for our users but 
MS> all the How-To files seem rather complicated :-(

MS> We have been using Samba for several years and all our users have
Windows 2000 PCs, Samba accounts etc. They log into their Windows with a
username/password OK. The Samba server is set up with the same
username/password combination as their PCs so they don't have to supply
username/password again and drive mappings are saved by Windows. A very
simple system which has proved easy to maintain. 

MS> We are trying now to introduce "Generic" PCs which any user can access
(hot desking I think it is called). So, we want the Samba server to prompt
the user for a username/password combination when they click on the desktop
shortcut to the server (we've accomplished that part easily) and then
automatically run a login script to map their drives - that's the part we
are struggling to find a solution to. 

MS> All the examples we've found so far refer to "Domain Controllers" - Do
we have to set up the server as a Domain controller, do we have to create
machines accounts etc ? 

A domain controller would be my prefered solution.
But you can use log

Re: [Samba] Running a login script

2008-03-19 Thread Mike Stewart
Thanks Dennis,

I should think that will all work OK but it's not what I expected at all :-(

I had assumed that the smb.conf entry for "logon script = %U.bat" was all that 
would be needed and would pick up the user's name and password as they logged 
into the server (through a desktop shortcut) and run that script which would 
map the required drives etc.

Basically what we want is to set up all our Win2000 PCs to log into windows as 
a generic staff member then when they click on the desktop shortcut they are 
prompted for their server username & password and... hey presto all their 
network drives appear in My Computer.

ATB

Mike


- Original Message -
From: "Dennis McLeod" <[EMAIL PROTECTED]>
To: samba@lists.samba.org
Sent: 19 March 2008 15:12:58 o'clock (GMT) Europe/London
Subject: RE: [Samba] Running a login script

You can run it from anywhere, BUT, you'd have to have the drive mapped first
if it's on a network share.
You MAY be able to do a //server/share/logonscript.bat (I flipped the
slashes on purpose...), but I haven't tried that.

I copy a simple script (I have THAT as part of my logon script, too. Copy a
new one if it's different. Robocopy) to the local machine, and that one
launches the logon script from the server.

My local script looks like:
@echo off
net use q: \\server\login SECRETPASSWORD /user:login /persistent:no > NUL
CALL q:\logon.bat > NUL


Then my REAL logon script is the q:\logon.bat

I used gpedit to point the machine at the local batch file.


I have a registry string (For XP) to make the gpedit part easy:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts]

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
]

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
\0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\User"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
\0\0]
"Script"="logoff.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logon]

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logon\
0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\User"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logon\
0\0]
"Script"="logonscript.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00


Save that as a .reg file, and you can double click it to merge the file.
(Notice there is a logoff script in there too..)

I put THAT in my (server) logon script too, and ran the logon script the
first time remotely, with psexec:

"C:\Documents and Settings\Admin\Desktop\PsTools\psexec.exe" @machines.txt
-u administrator -p SECRETPASSWORD -c logon.bat >> c:\psexec\results.txt

The machines.txt file is the list of machines I want it to run on.
You must know the (or another account with admin privileges) administrator
account password
Hope that helps...

I tested this manually on a few machines first, before I ran it on the
rest..

Dennis




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mike Stewart
Sent: Wednesday, March 19, 2008 3:02 AM
To: Jean-Jacques Moulis
Cc: samba@lists.samba.org
Subject: Re: [Samba] Running a login script

Hi JJ, thanks for the response.

Does this mean we create and store a script on the Windows PC ?  

We actually want to automatically run a script which resides on the Samba
server - once the user has logged in we want to automatically to map drives
etc.

Regards

Mike

- Original Message -
From: "Jean-Jacques Moulis" <[EMAIL PROTECTED]>
To: "Mike Stewart" <[EMAIL PROTECTED]>, samba@lists.samba.org
Sent: 19 March 2008 07:06:32 o'clock (GMT) Europe/London
Subject: Re: [Samba] Running a login script

On Tue, 18 Mar 2008 11:46:58 + (GMT) Mike Stewart
<[EMAIL PROTECTED]> wrote:

MS> Hello all,

MS> We are trying to find a way to run login scripts for our users but 
MS> all the How-To files seem rather complicated :-(

MS> We have been using Samba for several years and all our users have
Windows 2000 PCs, Samba accounts etc. They log into their Windows with a
username/password OK. The Samba server is set up with the same
username

Re: [Samba] Running a login script

2008-03-19 Thread Charles Marcus

On 3/19/2008, Mike Stewart ([EMAIL PROTECTED]) wrote:
I had assumed that the smb.conf entry for "logon script = %U.bat" was 
all that would be needed and would pick up the user's name and 
password as they logged into the server (through a desktop shortcut) 
and run that script which would map the required drives etc.


Basically what we want is to set up all our Win2000 PCs to log into 
windows as a generic staff member then when they click on the desktop 
shortcut they are prompted for their server username & password 
and... hey presto all their network drives appear in My Computer.


I'm trying real hard to understand why you wouldn't just set the server 
up as a proper domain controller... it makes stuff like this brain-dead 
easy...


--

Best regards,

Charles
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Running a login script

2008-03-19 Thread Mike Stewart
Thanks Charles,

I think you're right, what I'm trying to accomplish is probably better/easier 
with a Domain Controller.  However, I'm surely brain-dead as I've tried to set 
the box up as a Domain Controller and although my Windows machine will login in 
to the domain it still won't run the script so I think I must be missing 
something.  Domain Controllers are a completely new thing to me so it's no 
surprise I'm struggling :-(

If anyone has a simple example smb.conf file that does all this and any other 
hints I'd much appreciate it.

Regards

Mike... struggling, exhausted, frustrated 


- Original Message -
From: "Charles Marcus" <[EMAIL PROTECTED]>
To: samba@lists.samba.org
Sent: 19 March 2008 20:26:47 o'clock (GMT) Europe/London
Subject: Re: [Samba] Running a login script

On 3/19/2008, Mike Stewart ([EMAIL PROTECTED]) wrote:
> I had assumed that the smb.conf entry for "logon script = %U.bat" was 
> all that would be needed and would pick up the user's name and 
> password as they logged into the server (through a desktop shortcut) 
> and run that script which would map the required drives etc.
> 
> Basically what we want is to set up all our Win2000 PCs to log into 
> windows as a generic staff member then when they click on the desktop 
> shortcut they are prompted for their server username & password 
> and... hey presto all their network drives appear in My Computer.

I'm trying real hard to understand why you wouldn't just set the server 
up as a proper domain controller... it makes stuff like this brain-dead 
easy...

-- 

Best regards,

Charles
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


-

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Running a login script

2008-03-20 Thread Gareth Cummings

I found the following link very good when setting up my domain

http://us1.samba.org/samba/docs/man/Samba-Guide/small.htm

Mike Stewart wrote:

Thanks Charles,

I think you're right, what I'm trying to accomplish is probably better/easier 
with a Domain Controller.  However, I'm surely brain-dead as I've tried to set 
the box up as a Domain Controller and although my Windows machine will login in 
to the domain it still won't run the script so I think I must be missing 
something.  Domain Controllers are a completely new thing to me so it's no 
surprise I'm struggling :-(

If anyone has a simple example smb.conf file that does all this and any other 
hints I'd much appreciate it.

Regards

Mike... struggling, exhausted, frustrated 



- Original Message -
From: "Charles Marcus" <[EMAIL PROTECTED]>
To: samba@lists.samba.org
Sent: 19 March 2008 20:26:47 o'clock (GMT) Europe/London
Subject: Re: [Samba] Running a login script

On 3/19/2008, Mike Stewart ([EMAIL PROTECTED]) wrote:
  
I had assumed that the smb.conf entry for "logon script = %U.bat" was 
all that would be needed and would pick up the user's name and 
password as they logged into the server (through a desktop shortcut) 
and run that script which would map the required drives etc.


Basically what we want is to set up all our Win2000 PCs to log into 
windows as a generic staff member then when they click on the desktop 
shortcut they are prompted for their server username & password 
and... hey presto all their network drives appear in My Computer.



I'm trying real hard to understand why you wouldn't just set the server 
up as a proper domain controller... it makes stuff like this brain-dead 
easy...


  

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba