Giter Site home page Giter Site logo

adschema's Introduction

ADSchema

A PowerShell Module that can be used to update the schema in Active Directory

Installation

Install-Module ADSchema

Example

New-ADSchemaAttribute -Name asFavColor -Description 'User Favorite Color' -AttributeType String
New-ADSchemaClass asPerson -AdminDescription 'Person Class to host custom attributes' -Category Auxiliary
Add-ADSchemaAttributeToClass -Attribute asFavColor -Class asPerson
Add-ADSchemaAuxiliaryClassToClass -AuxiliaryClass asPerson -Class user
set-aduser andy -add @{'asFavColor' = 'blue'}
get-aduser andy -properties asFavColor

Overview

The purpose of this module is to allow users to easily add attributes and classes to the schema of Active Directory. Editing the schema is often a daunting task and requires knowledge of several details that most people do not think about on a regular basis.

There is also a lot of fear when it comes to manually adding attributes, because it is a task that cannot be undone. Attributes in AD can be disabled, but they cannot be deleted.

Most of the time, an AD Administrator will want to add a handful of attributes to either user or computer objects for some reason or another. Maybe you want to store a computer's warranty expiration date in AD or you want to put some data you have in your HR System in AD for users,but there isn't a good fit with the out of the box attributes. Attributes should typically be named with a prefix. If I was creating a warranty expiration attribute for my computers, I would use soemthing like as-warrantyDate.

Usually, the best practice is to create your new attributes, and then also create a new class. The new class should be an Auxiliary class. This essentially means that it can extend an existing class.

Once you create the Auxiliary class, you can bind it to an existing class. This is actually something that can be undone, so it reeduces the fear and worry of really messing up your Active Directory.

Last, a quick note about Object Identifiers, also known as OID. OID's are what are used as unique identifiers of schema attributes and classes in Active Directory. They are also used in MIB's for networking. For development purposes, you can generate your own OID's. There is even a function in this module that will do it for you. However, if you are going to extend your production schema, you should register for a Private Enterprise Number. Information on this can be found at http://pen.iana.org/pen/PenApplication.page.

adschema's People

Contributors

andyschneiderdev-zz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

adschema's Issues

Added ComputerName and Credential parameters and Pester tests

Soo... I forked this repository because I wanted so I could add ComputerName and Credential parameters to target different domains, and I got a little carried away. I am wondering if you are interested in a pull request containing the (pretty extensive) changes I made.

You can check out the fork here: https://github.com/robderickson/ADSchema

It might need a rebase to clean up all of my commit messages. I am a bit of a git newb. I regret not reaching out to submit PRs sooner; before I made so many drastic changes.

Here is a summary of what I changed:

  • Re-organized the project to fit how I usually structure my modules.
  • Added a vagrantfile and related scripts to build a 2019 domain controller (used for executing the original Pester tests that had no mocks)
  • Added ComputerName and Credential parameters to all functions except New-ADSchemaTestOid.
  • Created private functions for calling the FindClass and FindAllClasses methods of the ActiveDirectorySchema object, so I could Mock them in Pester.
  • Rewrote existing tests to use Mocks so Pester can be invoked without an Active Directory environment present.
  • Added additional tests for the New* and Add* functions.

I am hoping these changes will A) be useful to others, and B) make contributing to the module easier (assuming my tests are good).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.