• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 39
  • Last Modified:

calculated properties windows 7 connected to windows 2012 domain

I am typing In the following command get-aduser username -properties memberof | select-object  {$_.memberof}  I was hoping to get the following output. For some reason I am not. I am using a windows 7 machine and have done the import-module active directory.


group1
group2
group3
group4

I was wondering why is this not occurring here.
0
techdrive
Asked:
techdrive
  • 3
  • 3
1 Solution
 
SubsunCommented:
By default you get the DN of groups from memberof attribute.. To get names of group try...
Get-ADuser username -properties memberof | %{$_.memberof | Get-Adgroup | select Name}

Open in new window

Or use
Get-ADPrincipalGroupMembership username | Select Name

Open in new window

0
 
techdriveAuthor Commented:
sweet thanks it worked. So can I use this method for almost any multi valued comma delimited property. If I am using the correct terminology.
0
 
SubsunCommented:
If you are trying to export result, I would suggest you to use the custom property option so you can export all required properties of user.. Example..
Get-ADuser username -properties memberof | Select Name,SamaccountName,@{N="memberof";E={$_.memberof | Get-Adgroup | select -exp Name}}

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
techdriveAuthor Commented:
like always thank you very much for your help. You have always been extremely helpful.
0
 
techdriveAuthor Commented:
very helpful
0
 
SubsunCommented:
You are welcome!
0

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now