Powershell

PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. 

Launch a Program on a Remote Server

Sometimes, you may need to execute a program or process on a remote server from another machine. Fortunately, PowerShell provides a command to achieve this.


Applicable to: Windows Server 2022, 2019, 2016, 2012 R2, and 2012

You can use Windows Remote Management with the winrs command to remotely manage and run programs:

winrs -r:<REMOTE_SERVER> <PROGRAM>

# For example: 
winrs -r:my_server cmd.exe

In this example, a Command Prompt will be launched on my_server from the local machine, behaving as though it was directly executed on the remote server.

Get all DNS records in a specified zone in a Specific DNS Server

You can easily retrieve DNS records from a specific DNS server using a simple PowerShell command.


Get-DnsServerResourceRecord -ComputerName [DNS_SERVER] -ZoneName [ZONE_EXTENSION] -RRType [A|AAAA|CNAME|…]

# For example:
Get-DnsServerResourceRecord -ComputerName DC01 -ZoneName example.com -RRType CNAME

In the example above, the command queries the DNS server DC01 to retrieve all CNAME records within the example.com DNS zone.

This method allows you to specify the DNS record type (A, AAAA, CNAME, etc.) and zone name, making it an efficient way to manage and troubleshoot DNS settings on your network.

Set the Timezone

Sometimes, the modification of the time zone is not available in the graphical interface of Windows. No worries, let's use Powershell.


On the computer or server you wish to change the time zone, run the following command:

Set-TimeZone -Id "Romance Standard Time"

In this example, I set the time zone to the Romance Standard Time, which is the time zone for Europe/Brussels.

You can list all available time zones with the following command:

Get-TimeZone -ListAvailable