Ok, this should get you the basic information you want, sort it
alphabetically then filter it down to List name and managed by.  The
ManagedBy will be domain\username.  If you run it through a Select
DisplayName the output gets a little funky.

PS:> Get-QADMemberOf sepeck | Get-QADGroup | sort Name | select Name,
@{Name="ManagedBy";Expression={get-qaduser $_.managedby }} |
Export-Csv ./filename.csv -NoTypeInformation

Note, when you use the Select cmdlet, you are reducing data available.
 This is fine for a lot of things (such as this) but it does reduce
available information.

Export-Csv uses the dotNet framework and as such will add the
information type as the first line.  I find that annoying so the
-NoTypeInformation avoids it.

For more control you can pull the whole thing through an object.  I
have not played with remove-qadmemberof and the built in example is
missing but would guess something like below would work.

PS:> Get-QADMemberOf sepeck | Remove-QADMemberOf

I don't do much user management so I dug up this for clearing the
ManagedBy field.  (It may be easier with the Set-QADUser cmdlet but
don't have time to experiment for you).
http://theexpertscommunity.com/item/show/blog/1359

If you are interested I can rework my top example into an object for you.

Steven Peck
http://www.blkmtn.org


On Mon, Nov 30, 2009 at 10:33 AM, Steven Peck <[email protected]> wrote:
> What is the command you are using.  Some of the 'default' formatting
> will 'appear' to truncate.  Especially anything involving
> format-table.  On format-table you can often use the -autosize switch.
>
> So...
> get-qadmemberof sepeck
> that gets me an output like you describe.  As does
> get-qadmemberof sepeck | get-qadgroup
>
>
> However, a little 'select' work will clear that up.
> get-qadmemberof sepeck | select Name
> or
> Get-QADMemberOf sepeck | Get-QADGroup | select Name
>
> Get-QADMemberOf sepeck | Get-QADGroup | select Name, managedby
>
> Now that will get you the fqdn of managed by field which is annoying.
> I have a script somewhere that filters it better but have a meeting to
> go to.  So maybe that will get you started on data collection part and
> will look for the script after the meeting gets out.
>
> Automatically doing something in exchange 2003 is not something I have
> done a lot of.  Just wmi stuff for data gathering.
>
> Steven Peck
> http://www.blkmtn.org
>
> On Mon, Nov 30, 2009 at 10:11 AM, Kurt Buff <[email protected]> wrote:
>> Ah, it might not be exactly what you think:
>>
>> I see lots of scripts to give me the members of a group.
>>
>> I don't see any at the moment that allow me to list what group
>> memberships a particular account has, write them to a file and then to
>> remove the account from those groups.
>>
>> I have the latest Quest commandlets, which includes 'get-qadmemberof'
>> and 'remove-qadmemberof', but I have a small problem with them:
>> Get-QADMemberOf doesn't seem to return the full name of a longish
>> group - it returns a max of 28 characters, then appends '...' to the
>> end of it. This seems to happen so that it can accommodate a long DN,
>> as well. At least, it truncated the group name when I tried it at the
>> command line, and also when I piped the output to a file.
>>
>> It would also be good to be able to clear the manager attribute, then
>> export and delete the mailbox from the account, but I can save that
>> for later.
>>
>> Anyone have something like that?
>>
>> Exchange 2003 and AD 2003 R2, if that makes a difference - and I've
>> just downloaded PowerShell 2.0, too, but haven't had a chance to play
>> with it.
>>
>> Kurt
>>
>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>
>
> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>
>

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to