Solved

Powershell list attributes

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

815 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

9 Experts available now in Live!

Get 1:1 Help Now