PoshCode Logo PowerShell Code Repository

List AD Attributes by arnel 11 weeks ago (modification of post by BSonPosh view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/6680"></script>download | new post

List active directory attributes from schema

  1. $forest = [DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
  2. $Schema = $forest.schema
  3. $Properties = $Schema.FindAllProperties()
  4. foreach($property in $Properties)
  5. {
  6.    "#################################"
  7.    "Name:   {0}" -f $property.Name
  8.    "Link:   {0}" -f $property.link
  9.    "LinkID: {0}" -f $property.linkid
  10.    if(!$?)
  11.    {
  12.         "Error: {0}" -f $error[0].message
  13.    }
  14.    "#################################"
  15. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me