![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | help with for next loop hello guys I have a script that enumerate users that are members of a given group. what I need to do is to log this information in a single line. of course with this for next loop I'm going to get as many lines as users. Is there a way I can get this data into a single line (or variable ?) ? The point is, this information must be written in the event log of a server and I would like to have a single entry per group, instead of a log entry per member. I hope it's clear and there is a simple way to work around this. thanks and regards, zz For Each objUser in objGroup.Members sho.LogEvent 4, objUser.AdsPath Next |
My System Specs![]() |
| | #2 (permalink) |
| | Re: help with for next loop <zerbie45@xxxxxx> wrote in message news:744b1305-c873-4af1-ac7e-534b91938864@xxxxxx Quote: > hello guys > > I have a script that enumerate users that are members of a given > group. > what I need to do is to log this information in a single line. of > course with this for next loop I'm going to get as many lines as > users. > > Is there a way I can get this data into a single line (or > variable ?) ? > The point is, this information must be written in the event log of a > server and I would like to have a single entry per group, instead of a > log entry per member. > > I hope it's clear and there is a simple way to work around this. > > thanks and regards, > zz > > > For Each objUser in objGroup.Members > sho.LogEvent 4, objUser.AdsPath > Next result = "" For Each objUser in objGroup.Members result = result & " " & objUser.AdsPath Next sho.LogEvent 4, result /Al |
My System Specs![]() |
| | #3 (permalink) |
| | Re: help with for next loop On Jan 7, 1:54*pm, "Al Dunbar" <aland...@xxxxxx> wrote: Quote: > <zerbi...@xxxxxx> wrote in message > > news:744b1305-c873-4af1-ac7e-534b91938864@xxxxxx > > > > > Quote: > > hello guys Quote: > > I have a script that enumerate users that are members of a given > > group. > > what I need to do is to log this information in a single line. of > > course with this for next loop I'm going to get as many lines as > > users. Quote: > > Is there a way I can get this data into a single line (or > > variable ?) ? > > The point is, this information must be written in the event log of a > > server and I would like to have a single entry per group, instead of a > > log entry per member. Quote: > > I hope it's clear and there is a simple way to work around this. Quote: > > thanks and regards, > > zz Quote: > > For Each objUser in objGroup.Members > > sho.LogEvent 4, objUser.AdsPath > > Next > try this: > > * * result = "" > * * For Each objUser in objGroup.Members > * * * * result = result & " " & objUser.AdsPath > * * Next > * * sho.LogEvent 4, result > > /Al- Hide quoted text - > > - Show quoted text - regards, zz |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| loop? | General Discussion | |||
| I might be out of the loop but... | General Discussion | |||
| loop through all ad objects | PowerShell | |||
| Do Loop | Vista General | |||
| Log-In Loop | Vista installation & setup | |||