![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | IsMember query Hi I want to deploy a shortcut using the IsMember to 6 different security groups I've used the following to deploy to a single group, how can I include 6 different groups? If IsMember(strUserName, "Group1") = 1 Then StrShortCutName = "Group1) FSO.copyFile strStartMenuShortcutsFolder & strShortCutName & ".lnk" FlogFile.WriteLine(StrShortCutName & " Shortcut Created,") |
My System Specs![]() |
| | #2 (permalink) |
| | Re: IsMember query Hello Thanks for responding. I have 6 security groups based on their respective department. I want to deploy a shortcut to each department based on their group membership I've since found that these 6 groups contain nested groups and that the IsMember function does not support nested groups. What is the best way to deploy the shortcut to security groups which contain nested groups? "Matthias Tacke" wrote: Quote: > CALLUM Mac wrote: Quote: > > Hi > > > > I want to deploy a shortcut using the IsMember to 6 different security groups > > > > I've used the following to deploy to a single group, how can I include 6 > > different groups? > > > > If IsMember(strUserName, "Group1") = 1 Then > > StrShortCutName = "Group1) > > FSO.copyFile strStartMenuShortcutsFolder & strShortCutName & ".lnk" > > FlogFile.WriteLine(StrShortCutName & " Shortcut Created,") > It's unclear to me if you want to create one shortcut or one for every > group the user is member of? > > In general > > arrGroups = Array("Group1","Group2") > For Each strGroup In arrGroups > If (IsMember(strUserName, strGroup) = True) Then ... > Next > > > -- > HTH > Matthias > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: IsMember query CALLUM Mac wrote: Quote: > Hello > > Thanks for responding. > > I have 6 security groups based on their respective department. I want to > deploy a shortcut to each department based on their group membership > > I've since found that these 6 groups contain nested groups and that the > IsMember function does not support nested groups. > > What is the best way to deploy the shortcut to security groups which contain > nested groups? > Search Google with the keywords: vbscript IsMember nested groups <http://www.google.com/search?q=vbscript+ismember+nested+groups> The first very informative entry is: <http://www.rlmueller.net/freecode2.htm> -- HTH Matthias |
My System Specs![]() |
| | #4 (permalink) |
| | Re: IsMember query "Matthias Tacke" <Matthias@xxxxxx> wrote in message news:gma210$q5o$1@xxxxxx Quote: > CALLUM Mac wrote: Quote: >> Hello >> >> Thanks for responding. I have 6 security groups based on their respective >> department. I want to deploy a shortcut to each department based on their >> group membership >> >> I've since found that these 6 groups contain nested groups and that the >> IsMember function does not support nested groups. >> >> What is the best way to deploy the shortcut to security groups which >> contain nested groups? >> > There are variants of the IsMember Function available. > > Search Google with the keywords: vbscript IsMember nested groups > <http://www.google.com/search?q=vbscript+ismember+nested+groups> > > The first very informative entry is: > <http://www.rlmueller.net/freecode2.htm> http://www.rlmueller.net/freecode1.htm /Al |
My System Specs![]() |
| | #5 (permalink) |
| | Re: IsMember query Just written this, not tested it thoroughly but it looks OK in principle and is much quicker than stepping through object properties. Let me know how you get on. Function IsMember(sGroup) Set oADSystemInfo = CreateObject("ADSystemInfo") Set oDic = CreateObject("Scripting.Dictionary") Call GetMemberOf(oADSystemInfo.UserName, oDic) IsMember = oDic.Exists(sGroup) End Function Sub GetMemberOf(sDN, oDic) Set oConnection = CreateObject("ADODB.Connection") oConnection.Open "Provider=AdsDSOObject" Set oRootDSE = GetObject("LDAP://RootDSE") sLDAP = "<LDAP://" & oRootDSE.Get("defaultNamingContext") & ">;" Set oResults = oConnection.Execute(sLDAP & "(distinguishedName=" & sDN & ");memberof;subtree") If Not oResults.EOF Then aMemberOf = oResults("memberof") If IsArray(aMemberOf) Then For Each sMemberOf in aMemberOf sCN = Replace(Left(sMemberOf, InStr(sMemberOf, ",") - 1), "CN=", "") If Not oDic.Exists(sCN) Then oDic.Add sCN, "" Call GetMemberOf(sMemberOf, oDic) Next End If End If End Sub |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Tab key query | Vista General | |||
| RAM query | General Discussion | |||