PowerShell

Overview
This page will display commands in PowerShell to complete Basic to Advanced tasks in any Windows OS.

Active Directory

 * 1) Load the AD PowerShell provider

Import-Module Active Directory


 * 1) Display loaded modules

Get-Module


 * 1) Display all Active Directory related commands

Get-Command -Module ActiveDirectory


 * 1) Display all users and SID's in the domain

Get-ADUser -filter {Name -like "*"} | Select Name, SID | FT -Auto


 * 1) Display details for the Administrator

Get-ADUser -Filter {Name -eq "Administrator"} -Properties *


 * 1) Display basic details for the domain

Get-ADDomain "domain name"


 * 1) Display domain controllers

Get-ADDomainController -Discover


 * 1) Create a new OU

New-ADOrganizationUnit -Name "Europe" -Path "DC=domain,DC=com"


 * 1) Display information on the new OU

Get-ADOrganizationalUnit "OU=Europe,DC=domain,DC=com" -Properties