My PowerShell Commands List

Some PowerShell commands that I put here to remember.

Active Directory

PS C:\Users\Administrator> Install-WindowsFeature AD-domain-services -Restart -IncludeManagementTools
PS C:\Users\Administrator> Import-Module ADDSDeployment
PS C:\Users\Administrator> Install-AddsForest
PS C:\Users\Administrator> Install-WindowsFeature RSAT-ADDS
PS C:\Users\Administrator> $OU = "OU=Servers,DC=shebangthedolphins,DC=net"
PS C:\Users\Administrator> $Domain = "shebangthedolphins.net"
PS C:\Users\Administrator> $Cred = "shebangthedolphins.net\administrator"
PS C:\Users\Administrator> Add-Computer -DomainName $Domain -OUPath $OU -Credential $Cred -Restart -Force

General

PS C:\Users\Administrator> Copy-Item C:\*.ini -Destination E:\Temp\
PS C:\Users\Administrator> Move-Item C:\*.txt -Destination E:\Temp\
PS C:\Users\Administrator> Set-Date -date "12/7/2017 3:57 PM"
PS C:\Users\Administrator> $a = Get-Item '.\Downloads\My_File.txt'
PS C:\Users\Administrator> $a.LastWriteTime = "06/25/2016 8:00 AM"
PS C:\Users\Administrator> Get-WindowsFeature Hyper-V*
PS C:\Users\Administrator> Install-WindowsFeature Hyper-V -Restart -IncludeManagementTools
PS C:\Users\Administrator> Get-Module
PS C:\Users\Administrator> Get-Command -Module Hyper-V
PS C:\Users\Administrator> Rename-Computer NewName -Restart
PS C:\Users\Administrator> Get-WmiObject win32_product | Select-Object -Property Name,Version | Export-Csv -Path c:\My_Programs_List.csv

Network

PS C:\Users\Administrator> Get-NetIPAddress
PS C:\Users\Administrator> Get-NetIPConfiguration
PS C:\Users\Administrator> Get-NetIPInterface
PS C:\Users\Administrator> New-NetIPAddress -InterfaceAlias "InterfaceAlias" -IPAddress 192.168.1.10 -PrefixLength 24 -DefaultGateway 192.168.1.254 -AddressFamily IPv4
PS C:\Users\Administrator> Set-DnsClientServerAddress -InterfaceAlias "InterfaceAlias" -ServerAddresses 192.168.1.254
PS C:\Users\Administrator> Remove-NetIPAddress -InterfaceAlias "InterfaceAlias"
PS C:\Users\Administrator> Remove-NetIPAddress -InterfaceAlias "InterfaceAlias" -DefaultGateway 192.168.1.254
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :