On this page I’ll link to sample code that can be downloaded and used as an example of how certain actions can be done. These are based on the examples that have been used in posts, and whereas they are probably more complete than the code in the posts, they are still for educational purposes only!
There is no error checking, return codes or anything fancy to ensure that everything is being executed as expected. Despite this I hope you find them useful!
Setting Access Control Lists (ACLs)
Converting a DN to an FQDN
Raising Domain/Forest Functionality
Enable/Disable the Global Catalog role
Retrieving FSMO roles
Creating a Group
Creating a Account
Search for DC’s in AD that are not 2003 Servers
This work is licensed under a Creative Commons Attribution 3.0 License.