26 Feb
Posted by Roberto as Scripts
This vbs script consist into two verifications to restrict access of users from internet in Citrix XenApp (Presentation Server/Metaframe) servers or Terminal Services, to be included in the session initialization. The idea of this script allow access from users from Internet just if they are in a specific Active Directory group.
In the first verification, the script checks if the current user belongs to a group called “Remote Workers. If yes, the script jumps to the end. If no, the script goes to the second verification.
The second verification sees if is possible to ping the user workstation from the server. If the ping replies, means that the user is using the local network, then the script jumps to the end. If the ping doesn’t reply, the script will understand that the user is trying to access from internet, them he will be logged off from the server.
See the flow below to see better how this script works:


And follow the script bellow:
On Error Resume Next
Dim group_validation, target, ping_result
Set objNetwork = CreateObject(“WScript.Network”)
set objShell = CreateObject(“WScript.Shell”)
Set objUser = GetObject(“WinNT://” & objNetwork.UserDomain & “/” & objNetwork.UserName)group_validation = false
For each oGroup in objUser.Groups
if instr(oGroup.Name,”Remote Workers”) then group_validation = true
NextIf group_validation = false then
strTarget = objShell.ExpandEnvironmentStrings(“%ClientName%”)
Set objExec = objShell.Exec(“ping -n 2 -w 1000 ” & strTarget)
ping_result = LCase(objExec.StdOut.ReadAll)If InStr(ping_result, “reply from”)=0 Then
msgbox “Access denied”
objShell.run(“logoff”)
End if
End If‘msgbox “done”
Things to consider when you are going to use this script:
15 Responses
CAMERON
June 24th, 2010 at 1:57 pm
1Medicamentspot.com International Legal RX Medications. Special Internet Prices (up to 40% off average US price). NO PRIOR PRESCRIPTION REQUIRED!…
Combivir@buy.online” rel=”nofollow”>.…
RICK
June 26th, 2010 at 12:15 am
2Pillspot.org. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.PillSpot.org. Herbal-supplements@buy.online” rel=”nofollow”>.…
Categories: Mens Health.Skin Care.Womens Health.Anti-allergic/Asthma.Antidiabetic.Vitamins/Herbal Supplements.Stomach.Pain Relief.Anxiety/Sleep Aid.Antidepressants.Antiviral.Eye Care.Mental HealthBlood Pressure/Heart.Stop SmokingWeight Loss.Antibi…
Acai Berry
July 2nd, 2010 at 11:01 am
3This is one of the best posts that I’ve ever seen; you may include some more ideas in the same theme. I’m still waiting for some interesting thoughts from your side in your next post.
Acai Berry Colon Cleanse
July 2nd, 2010 at 11:06 am
4Hey this is really nice information. I was looking for something similar like this. Thanks for this useful information.
How To Get Pregnant Fast
July 2nd, 2010 at 11:07 am
5I really liked the post and the stories are really thanks for sharing the informative post.
Acai Berry
July 2nd, 2010 at 11:08 am
6hey buddy,this is one of the best posts that I’ve ever seen; you may include some more ideas in the same theme. I’m still waiting for some interesting thoughts from your side in your next post.
JACOB
July 21st, 2010 at 8:05 pm
7Buy:Actos.Valtrex.Petcam (Metacam) Oral Suspension.Retin-A.Mega Hoodia.Prevacid.Arimidex.Zovirax.Nexium.Synthroid.100% Pure Okinawan Coral Calcium.Accutane.Human Growth Hormone.Lumigan.Prednisolone.Zyban….
Acai Berry weight loss
August 21st, 2010 at 9:41 am
8As i go through your post. my queries solved automatically. i like to read more from you.
00 Film polaroid/
August 29th, 2010 at 8:31 am
9Sun http://APTAUTOPARTS.INFO/tag/Sun 6 : 00 Film polaroid/…
Sun…
18 Accessories Cars 118/
August 29th, 2010 at 10:45 am
1018 Accessories Cars 118/ http://04FORDPARTS.US/tag/1 : 18 Accessories Cars 118/…
18 Accessories Cars 118/…
Cameras
August 29th, 2010 at 10:22 pm
11Light http://gsqlipt-jp.AACEHARDWARE.INFO/tag/Red+Light+in+Albuquerque+camera+Cameras/ : Light…
Red…
Razr
August 29th, 2010 at 10:56 pm
12Prepaid http://mrazrhxvjs2.01DODGEPARTS.US/tag/Razr+K1+Prepaid+k1+RAZR/ : Razr…
Prepaid…
project
August 30th, 2010 at 2:45 am
13project http://qorderfe1.ACEHARDWAREE.INFO/tag/Casino+delivered+project/ : delivered…
delivered…
JERRY
September 5th, 2010 at 7:50 am
14Buy:Levitra.Cialis Professional.Propecia.Viagra Soft Tabs.Zithromax.VPXL.Viagra Super Active+.Cialis Super Active+.Viagra Super Force.Cialis.Cialis Soft Tabs.Soma.Viagra Professional.Super Active ED Pack.Tramadol.Viagra.Maxaman….
RICK
September 6th, 2010 at 4:10 am
15Buy:Prednisolone.Nexium.Prevacid.Zyban.Human Growth Hormone.Actos.100% Pure Okinawan Coral Calcium.Retin-A.Valtrex.Synthroid.Petcam (Metacam) Oral Suspension.Zovirax.Lumigan.Mega Hoodia.Accutane.Arimidex….
RSS feed for comments on this post · TrackBack URI
Leave a reply
Articles
Pages
Subscribe by RSS or Email
Recent Articles
Links
Archives
Recent Comments
Roberto Alves is proudly powered by WordPress