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

Comments

Please log in to comment

Community Chosen Answer

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

Answered 07/30/2012 by: jagadeish
Red Belt

Please log in to comment

Answers

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

Answered 07/30/2012 by: SMal.tmcc
Red Belt

Please log in to comment
2

Thanks Guys

Answered 07/31/2012 by: Automan
Senior Yellow Belt

  • If your problem was solved could you mark it as answered. Thanks
Please log in to comment
1

Nice Script Jagadeish..

Answered 07/31/2012 by: piyushnasa
Red Belt

  • very impressive, I voted for it
Please log in to comment
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...

 

Answered 08/01/2012 by: AgentMrQ
Senior White Belt

Please log in to comment
Answer this question or Comment on this question for clarity