/build/static/layout/Breadcrumb_cap_w.png

Launch URL Depending on Group Membership

Hi All,

So my problem is thus, I have an application that requires either of two URL's to be launched depending on what ad group a person is in.

 

For example, John is in one of 7 possible groups so he gets the UAT URL and Sarah is in one of a seperate 7 AD groups o she gets the PROD url.

 

Can I get App-V to creat one shortcut and with the help of some logic query the AD Groups and launch whichever URL?

 

I've been playing around with the Idea of having the shorcut point to a VBScript that checks the Memebership and in turn launches the URL.

 

Thanks

Automan.


0 Comments   [ + ] Show comments

Answers (5)

Posted by: jagadeish 12 years ago
Red Belt
4

Option Explicit

On Error Resume Next

Dim objShell,URL_1, URL_2, groupListD, groupName, ADSPath, userPath
Dim variable

set objShell = WScript.CreateObject("WScript.Shell")

URL_1="http://www.google.com"
URL_2="http://www.gmail.com"


If isMember("Group1") Then      
 objShell.Run URL_1
 
ElseIf isMember("Group2") Then      
 objShell.Run URL_2
 
End If

Function IsMember(groupName)    

 If IsEmpty(groupListD) then        
  Set groupListD = CreateObject("Scripting.Dictionary")        
  groupListD.CompareMode = 1        
  ADSPath = EnvString("userdomain") & "/" & EnvString("username")        
  Set userPath = GetObject("WinNT://" & ADSPath & ",user")        
  For Each listGroup in userPath.Groups            
   groupListD.Add listGroup.Name, "-"       
  Next   
 End if    
IsMember = CBool(groupListD.Exists(groupName))

End Function


Function EnvString(variable)    
variable = "%" & variable & "%"   
EnvString = objShell.ExpandEnvironmentStrings(variable)

End Function

Set objShell = Nothing
Set groupListD = Nothing
Set userPath = Nothing

WScript.Quit

Posted by: SMal.tmcc 12 years ago
Red Belt
2

Just push iexplore "URL" GPO's based on the context they are in.

http://www.itninja.com/link/applying-group-policy-to-a-machine-user-or-group-of-either

Posted by: Automan 12 years ago
Senior Yellow Belt
2

Thanks Guys


Comments:
  • If your problem was solved could you mark it as answered. Thanks - SMal.tmcc 12 years ago
Posted by: piyushnasa 12 years ago
Red Belt
1

Nice Script Jagadeish..


Comments:
  • very impressive, I voted for it - SMal.tmcc 12 years ago
Posted by: AgentMrQ 12 years ago
Senior White Belt
1

The script is really good but if you want to manage the shortcut and pull it back later, or have the option to, in an enterprise the GPP application shortcut is the way to go. You can use custom item-level target filters in the GPP application shortcut to limit who can see the URL link based on AD membersship and a lot of things like OS, RAM, free space, etc...

 

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ