Solved

Powershell list attributes

Posted on 2009-07-13
3
1,150 Views
Last Modified: 2012-05-07

For a WMI object, I can list all the values for an oject with this;
get-WmiObject win32_bios -comp server | Select-Object *

what is the command to have powershell list all the attributes (CN, sid, etc...) for a group?
what is the command to have powershell list all the attributes (CN, sid, etc...) for a user?
how does this change if I wanted to ask it about an AD user or group?
0
Comment
Question by:loftyworm
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Learnctx earned 500 total points
Comment Utility
You could try some of the ones below. I'm not actually near an AD environment at the moment, but from memory one of these should do the trick.

$objUser = [ADSI]"LDAP://cn=userid,ou=useraccountsou,dc=test,dc=lab"

$objUser | format-list *
 

$objGroup = [ADSI]"LDAP://cn=groupname,ou=groupsou,dc=test,dc=lab"

$objGroup | format-list *
 

$searcher = new-object directoryservices.directorysearcher

$searcher.pagesize = 999

$searcher.filter = "name=groupname"

$searcher.FindAll() | Foreach-Object {$_.Properties | fl *}

Open in new window

0
 
LVL 11

Author Comment

by:loftyworm
Comment Utility
Is there an easy way to find the DN for a user or group?

0
 
LVL 11

Author Comment

by:loftyworm
Comment Utility
the easy way to get the DN was with the DS command;
dsquery user domainroot -name *smith
dsquery group domainroot -name *smith
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now