This repository contains some small sample scripts.
This script demonstrates the usage of object-oriented features in PowerShell. It is recommended to run this in debug mode to understand what's going on. The comments will help understanding the concepts.
Demonstrates a reusable patter for creating text-based menus in controller scripts.
Demonstrates very simple functions without parameters, how to export users from Active Directory to a CSV file, and how to modify users based on data from an imported CSV file.
Demonstrates how to create an organizational unit (OU) in Active Directory. Within the OU, groups are created from data in a CSV file. An attribute is set on the groups and computers accounts are added as members.
Sample powershell script for retrieving computer inventory data and storing it in a database. Demonstrates working with SQL and error handling.
Module SQLUtility, which you can clone from https://github.com/Rokory/SQLUtility.
- Install some edition of Microsoft SQL server on the local computer. You can use
Install-SQLServer
from the SQLUtility module to quickly install an Express edition - Run the Setup-CIDatabase to create the database structure.
- Run the Update-CIAssets to store the computer inventory information in the database.