Hi Rob,

I am really thankfull to you if you can guide me in below lines

II have all inplace now. Please guide me in executing the lines step by
step. Where do i need to save the grouplist.txt and where should i save the
script and with what extension.



$grouplist = gc grouplist.txt



$users = get-qaduser –searchroot <path to ou>



Foreach ($user in $users){



            $ingroups = $false



            Foreach ($group in $grouplist){

            If ($user.memberof -contains $group){$ingroups = $true}

}

If ($ingroups){write-host $user}

}
Thanks

Naresh
On Tue, Sep 9, 2008 at 4:17 PM, Naresh Kumar <[EMAIL PROTECTED]> wrote:

>  Hi Rob,
>
> I have powershell installed. Could you plese tell me how should i run the
> below lines.
>
>  On Tue, Sep 2, 2008 at 7:04 PM, Campbell, Rob <
> [EMAIL PROTECTED]> wrote:
>
>>  If you have Powershell, and the free Quest cmdlets this should work:
>>
>>
>>
>> $grouplist = gc grouplist.txt
>>
>>
>>
>> $users = get-qaduser –searchroot <path to ou>
>>
>>
>>
>> Foreach ($user in $users){
>>
>>
>>
>>             $ingroups = $false
>>
>>
>>
>>             Foreach ($group in $grouplist){
>>
>>             If ($user.memberof -contains $group){$ingroups = $true}
>>
>> }
>>
>> If ($ingroups){write-host $user}
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>> The group list and path to the ou need to be the DN's of the groups and
>> OU.  The groups are read from a text file (grouplist.txt), but you can hard
>> code the list into the script if you want.
>>
>>
>>
>> Eg
>>
>>
>>
>> "cn=group1,ou=groups,dc=domain,dc=tld" for the groups
>>
>>
>>
>> "ou=user groups,dc=domain,dc=tld" for the OU.
>>
>>
>>
>>
>>
>> If you don't have Powershell yet, what are you waiting for?
>>
>>
>>  ------------------------------
>>
>> *From:* Naresh Kumar [mailto:[EMAIL PROTECTED]
>> *Sent:* Tuesday, September 02, 2008 8:08 AM
>> *To:* Active Directory Admin Issues
>> *Subject:* Scripting
>>
>>
>>
>> ~ NEW: CounterSpy Enterprise: Centralized Antispyware - #1 in eWEEK Test! ~
>>
>>     ~    ~
>>
>> **************************************************************************************************
>> Note:
>> The information contained in this message may be privileged and confidential 
>> and
>> protected from disclosure.  If the reader of this message is not the intended
>> recipient, or an employee or agent responsible for delivering this message to
>> the intended recipient, you are hereby notified that any dissemination,
>> distribution or copying of this communication is strictly prohibited. If you
>> have received this communication in error, please notify us immediately by
>> replying to the message and deleting it from your computer.
>> **************************************************************************************************
>>
>>
>> ~ NEW: CounterSpy Enterprise: Centralized Antispyware - #1 in eWEEK Test! ~
>>     ~    ~
>>
>>
>  ~ NEW: CounterSpy Enterprise: Centralized Antispyware - #1 in eWEEK Test! ~
>     ~    ~
>
>

~ NEW: CounterSpy Enterprise: Centralized Antispyware - #1 in eWEEK Test! ~
    ~  <http://www.sunbelt-software.com/product.cfm?id=400>  ~

Reply via email to