Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Logon Script that Needs to Log off a user if accessing terminal from home

21 views
Skip to first unread message

recuerdeme

unread,
May 26, 2011, 6:16:12 PM5/26/11
to
I've built a vbs logon script... and the last thing I need to do is
setup a final if condition

I have a limited access group (active directory user group) that
should only be able to access our terminal server from the office
(RDP) and no where else.
So I need to check the Clients local IP address against the Office's
static local IP address if the two don't match halt the user and log
him off

Here's the script
If (usersIPaddy <> "1.1.1.1") Then '''''how do I get usersIPaddy is
in question.
MsgBox("You do not have permission to access the server from this
location.")
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run("shutdown /l")
End If

Al Dunbar

unread,
May 29, 2011, 7:13:32 PM5/29/11
to

>"recuerdeme" wrote in message
>news:1a4f39fd-171d-4f9c...@f9g2000vbz.googlegroups.com...

You would be better off finding a way to prevent these people from logging
on via RDP from outside the subnet than to let them logon and think you can
implement this security policy by script.

First thing: are your users able to cancel a running logon script? Ours are,
but they generally don't, mainly because our logon script does not try to
restrict their access in any way.

Second thing: if your users simply do not bother to click OK on the message
box button, will they not already have access to everything?

/Al

recuerdeme

unread,
May 31, 2011, 10:40:21 AM5/31/11
to
On May 29, 6:13 pm, "Al Dunbar" <aland...@hotmail.com> wrote:
> >"recuerdeme"  wrote in message
> >news:1a4f39fd-171d-4f9c...@f9g2000vbz.googlegroups.com...
>
> >I've built a vbslogonscript... and the last thing I need to do is
> >setup a finalifcondition
>
> >I have a limited access group (active directoryusergroup) that

> >should only be able to access our terminal server from the office
> >(RDP) and  no where else.
> >So I need to check the Clients local IP address against the Office's
> >static local IP addressifthe two don't match halt theuserandlog
> >himoff
>
> >Here's thescript
> >If(usersIPaddy <> "1.1.1.1") Then  '''''how do I get usersIPaddy is

> >in question.
> >MsgBox("You do not have permission to access the server from this
> >location.")
> >Set wshShell = WScript.CreateObject ("WSCript.shell")
> >wshshell.run("shutdown /l")
> >EndIf
>
> You would be betterofffinding a way to prevent these people from logging
> on via RDP from outside the subnet than to let themlogonand think you can

> implement this security policy byscript.
>
> First thing: are your users able to cancel a runninglogonscript? Ours are,
> but they generally don't, mainly because ourlogonscriptdoes not try to

> restrict their access in any way.
>
> Second thing:ifyour users simply do not bother to click OK on the message

> box button, will they not already have access to everything?
>
> /Al

I think you're right, If they don't click ok then the code after the
msgbox doesn't execute... hmm
I haven't checked into restricting by subnet. I'm not sure how of
course ...

Al Dunbar

unread,
Jun 18, 2011, 6:47:35 PM6/18/11
to

"recuerdeme" wrote in message
news:abd2d0c6-25f6-470e...@18g2000prd.googlegroups.com...

I'm no expert in the area either, but I think it might be require the use of
group policy.

/Al

0 new messages