PowerShell scripts used for IP Professionals to keep their networks running smoothly.
Here, I will list all the commands I use and come across. (I will try to update it regularly)
I will also link to other Articles with commands used in real-world scenarios.
A fast way to access [PowerShell].
Perform the following to make it easy to open [PowerShell].
[Shift + Right-click] mouse ▶ [Open PowerShell window here].
Reboot your system. (Change the 0 value to the number in seconds that you wish to shut down or restart your system)
(This works the same on both CMD and PS.)
[PowerShell - Reboot]
CFFCS | CarrzSynEdit: | PS (PowerShell)
shutdown /r /t 0

[PowerShell - Shutdown]
CFFCS | CarrzSynEdit: | PS (PowerShell)
shutdown /s /t 0

[PowerShell - Reboot (Just found this one 06-06-2026)]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Restart-Computer

[PowerShell - Clear Terminal]
CFFCS | CarrzSynEdit: | PS (PowerShell)
cls
#And

ctrl+L

[PowerShell - To get out of a running process]
CFFCS | CarrzSynEdit: | PS (PowerShell)
CTRL+C

Other Articles Related to this Entry.
Just found these and had to test them out, and the grid view is an absolute keeper.

| out-gridview
Copy
Search Site
Search Google

#and
| export-csv path
Copy
Search Site
Search Google
Common Use Cases & Examples
[PowerShell - Basic View: Quickly view running processes in a searchable table.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Get-Process | Out-GridView

[PowerShell - Selection for Action: Choose specific services to restart from a list.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Get-Service | Out-GridView -Title "Select Services" -PassThru | Restart-Service

[PowerShell - Filtered Reporting: Display specific object properties with a custom window title.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Get-Process | Select-Object Name, CPU, ID | Out-GridView -Title "Process Monitor"

Script Shortcuts: Use the -Wait parameter in Windows shortcuts to keep the window open until you manually close it.
[PowerShell - Get the Physical Disks on your computer.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Get-PhysicalDisk | Select -Prop DeviceId,FriendlyName,SerialNumber

[PowerShell - Get the Drives in your computer.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
get-psdrive
#with   | out-gridview

get-psdrive  | out-gridview

[PowerShell - Get the Directory Folder structure in a Tree hierarchy.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
$Path = "F:\My Pictures"
Tree $Path /F | Select-Object -Skip 2 | Set-Content F:\output.txt

[PowerShell - Another Tree Output]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Get-ChildItem | tree /f > tree.log

The [Test-NetConnection] cmdlet displays diagnostic information for a connection. It supports ping test, TCP test, route tracing, and route selection diagnostics.
[PowerShell - diagnostic information for a connection]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Test-NetConnection

[PowerShell - Have your Terminal read to you]
CFFCS | CarrzSynEdit: | PS (PowerShell)
( New-Object -com SAPI.SpVoice ).speak(( Invoke-RestMethod -Uri 'https://www.cffcs.com/Stuff/talk.asp' ).fact )

[PowerShell - The code for the page above is.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
{"fact":"CFF Coding Source – Your place for learning to design database-driven web applications, 
using Classic ASP and ASP DOT NET for Visual Basic and C Sharp. Along with our website, 
we also host a YouTube channel at youtube.com/@cffcs. Make sure to add us to your web browser favorites, 
bookmark us, share us on your social networking page, and stay tuned for what we have in store for the future. 
I am Wayne Barron, and I will see you later.","length":60}

Server Admins
[PowerShell - Configure Your Windows Server]
CFFCS | CarrzSynEdit: | PS (PowerShell)
sconfig

[PowerShell - Get a list of all network adapters.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
get-netadapter -name "*" -Physical

In all our servers, I name the Network Adapters to make it easier to Team them together.
Performing this on many VMs is made simple using the two scripts below.
And then I team the NICs together. (Teaming is a way to create redundancy in your server's networking.
If one adapter goes down, the next one in line will take over, keeping your server online at all times. (0 Downtime and 99% Uptime)
[PowerShell - NIC Card Teaming]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Rename-NetAdapter -Name "Ethernet0" -NewName "NIC-1"
Rename-NetAdapter -Name "Ethernet1" -NewName "NIC-2"
Rename-NetAdapter -Name "Ethernet2" -NewName "NIC-3"
Rename-NetAdapter -Name "Ethernet3" -NewName "NIC-4"
new-NetLBFOTeam -Name "Team-Core-01" -TeamMembers "NIC-1", "NIC-2", "NIC-3", "NIC-4" -TeamingMode SwitchIndependent -LoadBalancingAlgorithm MacAddres

[PowerShell - Get the Name of the NIC Team]
CFFCS | CarrzSynEdit: | PS (PowerShell)
NetLbfoTeam

[PowerShell - Rename the NIC Team.]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Rename-NetLbfoTeam -Name "Team-Core-06" -NewName "Team-Core-02"

[PowerShell - Remove the NIC Team]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Remove-NetLbfoTeam -Name "Team-Core-01"

[PowerShell - Remove a Server from the domain]
CFFCS | CarrzSynEdit: | PS (PowerShell)
netdom remove Core-01 /domain:MyDomain.local /force

Check if the Windows Remote Management (WinRM) service is running and responsive on a local or remote computer. Get the Product Vendor and Product Version Number of a Remote Server
[PowerShell - ]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Test-WSMan -ComputerName "Server01" -Authentication Default

Open Notepad as Administrator
[PowerShell - ]
CFFCS | CarrzSynEdit: | PS (PowerShell)
powershell -Command "Start-Process notepad -Verb RunAs"

Promote one DC to be the Master.
If you have many DCs in your network and want to promote one of them to be the Master, run this script.
Change the DC-01 to the name of the DC you want to promote.
[PowerShell - ]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Move-ADDirectoryServerOperationMasterRole -Identity "DC-01" -OperationMasterRole SchemaMaster, DomainNamingMaster, PDCEmulator, RIDMaster, InfrastructureMaster -Force -Confirm:$false


After performing the above steps, run this command to verify that the DC you promoted is indeed the one in charge.
[Flexible Single Master Operations]
CFFCS | CarrzSynEdit: | PS (PowerShell)
netdom query fsmo

[Output should be something like this]
Schema master DC-10.my-domain.local
Domain naming master DC-10.my-domain.local
PDC DC-10.my-domain.local
RID pool manager DC-10.my-domain.local
Infrastructure master DC-10.my-domain.local
The command completed successfully.
PowerShell and IIS (Internet Information Services)
To get the Server Farm name.
[PowerShell - Server Farm name]
CFFCS | CarrzSynEdit: | PS (PowerShell)
Import-Module WebAdministration
Get-WebConfiguration -Filter "webFarms/webFarm" | Select-Object -ExpandProperty name

Output = Farm-01
Other Articles Related to this Entry.