PowerShell tips – part 004.

Another tutorial about powershell commands.
Get infos from Enviroment with powershell:
[Environment]::UserName
[Environment]::UserDomainName
[Environment]::MachineName

Test connection to server or test the network connectivity of a computer and get some common properties:
Test-Connection google.com

Test-Connection -ComputerName localhost -Count 1 |
Select-Object IPv4Address,ResponseTime,TimeToLive

Displays diagnostic information for a connection.
Test-NetConnection

Get a detailed IP configuration report for the current machine
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Select-Object -Property [a-z]* -ExcludeProperty IPX*,WINS*

Restart oone service, like DHCP
Restart-Service DHCP

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.