Jump to content

How to run a script when a user logs onto Term Srv


Recommended Posts

Posted

I have a Windows 2003 SP2 server running Terminal Services. I want to run a

script whenever any user logs onto the Terminal Server. The script will send

an email to an administrative mailbox and is a method for actively tracking

logons.

The "start a program upon connection" gp setting won't work since I don't

want to alter the session, I just want the script to run send the email

whenever a user logs on to the Terminal Server. Anyone know how I can set up

the script to run as planned?

 

Thanks

  • Replies 8
  • Created
  • Last Reply
Guest Paul
Posted

Re: How to run a script when a user logs onto Term Srv

 

How to Set Up a Logon Script Only for Terminal Server Users

 

http://support.microsoft.com/kb/195461

 

> I have a Windows 2003 SP2 server running Terminal Services. I want to run a

> script whenever any user logs onto the Terminal Server. The script will send

> an email to an administrative mailbox and is a method for actively tracking

> logons.

> The "start a program upon connection" gp setting won't work since I don't

> want to alter the session, I just want the script to run send the email

> whenever a user logs on to the Terminal Server. Anyone know how I can set up

> the script to run as planned?

>

> Thanks

>

Posted

Re: How to run a script when a user logs onto Term Srv

 

I saw mention of that KB on this site before posting my question and I tried

it and it didn't work, so two questions:

 

1) The KB only mention Win NT 4.0 in the products section. Does this work

for w2k3?

2) Does the change require a system restart to take effect?

 

Thanks

 

"Paul" wrote:

> How to Set Up a Logon Script Only for Terminal Server Users

>

> http://support.microsoft.com/kb/195461

>

>

> > I have a Windows 2003 SP2 server running Terminal Services. I want to run a

> > script whenever any user logs onto the Terminal Server. The script will send

> > an email to an administrative mailbox and is a method for actively tracking

> > logons.

> > The "start a program upon connection" gp setting won't work since I don't

> > want to alter the session, I just want the script to run send the email

> > whenever a user logs on to the Terminal Server. Anyone know how I can set up

> > the script to run as planned?

> >

> > Thanks

> >

>

Guest Paul
Posted

Re: How to run a script when a user logs onto Term Srv

 

Yes, works. I think the very next logon will work, but you know windows is a lot of cut and try.

 

> I saw mention of that KB on this site before posting my question and I tried

> it and it didn't work, so two questions:

>

> 1) The KB only mention Win NT 4.0 in the products section. Does this work

> for w2k3?

> 2) Does the change require a system restart to take effect?

>

> Thanks

>

> "Paul" wrote:

>

>> How to Set Up a Logon Script Only for Terminal Server Users

>>

>> http://support.microsoft.com/kb/195461

>>

>>

>>> I have a Windows 2003 SP2 server running Terminal Services. I want to run a

>>> script whenever any user logs onto the Terminal Server. The script will send

>>> an email to an administrative mailbox and is a method for actively tracking

>>> logons.

>>> The "start a program upon connection" gp setting won't work since I don't

>>> want to alter the session, I just want the script to run send the email

>>> whenever a user logs on to the Terminal Server. Anyone know how I can set up

>>> the script to run as planned?

>>>

>>> Thanks

>>>

Posted

Re: How to run a script when a user logs onto Term Srv

 

This isn't working for me after trying multiple scripts and a system restart.

I'm accessing the server via remote desktop, does this only work if the

server is running Terminal Services or should it work for with a remote

desktop connection?

 

Thanks

 

"Paul" wrote:

> Yes, works. I think the very next logon will work, but you know windows is a lot of cut and try.

>

>

> > I saw mention of that KB on this site before posting my question and I tried

> > it and it didn't work, so two questions:

> >

> > 1) The KB only mention Win NT 4.0 in the products section. Does this work

> > for w2k3?

> > 2) Does the change require a system restart to take effect?

> >

> > Thanks

> >

> > "Paul" wrote:

> >

> >> How to Set Up a Logon Script Only for Terminal Server Users

> >>

> >> http://support.microsoft.com/kb/195461

> >>

> >>

> >>> I have a Windows 2003 SP2 server running Terminal Services. I want to run a

> >>> script whenever any user logs onto the Terminal Server. The script will send

> >>> an email to an administrative mailbox and is a method for actively tracking

> >>> logons.

> >>> The "start a program upon connection" gp setting won't work since I don't

> >>> want to alter the session, I just want the script to run send the email

> >>> whenever a user logs on to the Terminal Server. Anyone know how I can set up

> >>> the script to run as planned?

> >>>

> >>> Thanks

> >>>

>

Guest Paul
Posted

Re: How to run a script when a user logs onto Term Srv

 

I know it works for win2k3 server and terminal services. I never tried it with remote desktop. I can't get it to work either.

> This isn't working for me after trying multiple scripts and a system restart.

> I'm accessing the server via remote desktop, does this only work if the

> server is running Terminal Services or should it work for with a remote

> desktop connection?

Posted

Re: How to run a script when a user logs onto Term Srv

 

The prod server will be running Term Services so I'll implement it when that

server is built.

Thanks for all the info

 

"Paul" wrote:

> I know it works for win2k3 server and terminal services. I never tried it with remote desktop. I can't get it to work either.

>

> > This isn't working for me after trying multiple scripts and a system restart.

> > I'm accessing the server via remote desktop, does this only work if the

> > server is running Terminal Services or should it work for with a remote

> > desktop connection?

>

Guest Soo Kuan Teo [MSFT]
Posted

Re: How to run a script when a user logs onto Term Srv

 

Have you tried putting your script to Start menu->Programs->Startup for all

users?

If you just want to tracking logons, you can also try to set the auditing

setting in Tscc.msc->Connections->RDp-Tcp->Permissions->Advanced->Auditing

Thanks

Soo Kuan

 

 

 

--

This posting is provided "AS IS" with no warranties, and confers no rights.

 

"pdx" <pdx@discussions.microsoft.com> wrote in message

news:E2B166CB-5EAB-4283-829E-C4204A5AF434@microsoft.com...

>I have a Windows 2003 SP2 server running Terminal Services. I want to run a

> script whenever any user logs onto the Terminal Server. The script will

> send

> an email to an administrative mailbox and is a method for actively

> tracking

> logons.

> The "start a program upon connection" gp setting won't work since I don't

> want to alter the session, I just want the script to run send the email

> whenever a user logs on to the Terminal Server. Anyone know how I can set

> up

> the script to run as planned?

>

> Thanks

>

Posted

Re: How to run a script when a user logs onto Term Srv

 

I have been able to run the script by configuring it as a logon script

through a gpo applied to the OU that contains the (test) Terminal Server, but

that configuration and - I think - the scenarios you mention have the effect

of logging for all users who log onto the server (such as admins logging on

physically).

My ultimate intention is to actively track users who logon to the server via

Terminal Services and send a notification email to a monitoring mailbox. The

solution I'm planning to use is the process (registry edit) mentioned earlier

in this thread to log only Terminal Services logons to a file then use Blat

to mail that file to the monitoring mailbox.

 

Thanks

 

"Soo Kuan Teo [MSFT]" wrote:

> Have you tried putting your script to Start menu->Programs->Startup for all

> users?

> If you just want to tracking logons, you can also try to set the auditing

> setting in Tscc.msc->Connections->RDp-Tcp->Permissions->Advanced->Auditing

> Thanks

> Soo Kuan

>

>

>

> --

> This posting is provided "AS IS" with no warranties, and confers no rights.

>

> "pdx" <pdx@discussions.microsoft.com> wrote in message

> news:E2B166CB-5EAB-4283-829E-C4204A5AF434@microsoft.com...

> >I have a Windows 2003 SP2 server running Terminal Services. I want to run a

> > script whenever any user logs onto the Terminal Server. The script will

> > send

> > an email to an administrative mailbox and is a method for actively

> > tracking

> > logons.

> > The "start a program upon connection" gp setting won't work since I don't

> > want to alter the session, I just want the script to run send the email

> > whenever a user logs on to the Terminal Server. Anyone know how I can set

> > up

> > the script to run as planned?

> >

> > Thanks

> >

>

>


×
×
  • Create New...