PowerShell
Created: July 01, 2020
Commands to research from tips posts
New-Net IPAddress
Set-DNSClientServerAddress
Test-NetConnection -Traceroute/ping/ports
Add-Computer -DomainName
Install-WindowsFeature
test-computersecurechannel -credential domain\admin -Repair (re-join domain)
set-netfirewallprofile -profile domain,public,private -enabled false
Get-ADForest <domain> | FT <role>
Move-ADDirectoryServerOperationsMasterRole (move roles)
Get-Hotfix
Export-Csv
Set-date
Set-Timezone
Search-ADAccount -PasswordNeverExpires | out-gridview
search-adaccount -UsersOnly –AccountDisabled
Start Transcript
Search-ADAccount -UsersOnly -AccountInactive -TimeSpan 90 | Get-ADUser -Properities Name, sAMAccountName, givenName, sn, userAccountControl | Where {($_.userAccountControl -band 2) -eq $False} | Select Name, sAMAccountName, givenName, sn
-ComputersOnly
$paramhash=@{
UsersOnly = $True
AccountInactive = $True
TimeSpan = New-Timespan -Days 120
SearchBase = "OU=Employees,DC=globomantics,dc=local"
Server = "chi-dc04"
}
Search-ADAccount @paramHash | measure