Solved

Powershell list attributes

Posted on 2009-07-13
3
1,156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Learnctx earned 500 total points
ID: 24845625
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
ID: 24851499
Is there an easy way to find the DN for a user or group?

0
 
LVL 11

Author Comment

by:loftyworm
ID: 24862273
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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