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
Solved

Powershell list attributes

Posted on 2009-07-13
3
1,154 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 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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 article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

861 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