PowerShell (DNS Record)

PowerShell (DNS Record)

PowerShell (DNS Record)

How to check DNS records on domain by PowerShell?

To check the DNS records of a domain using PowerShell, you can use the Resolve-DnsName cmdlet. Here’s how you can do it:

  • Open PowerShell:
  • Launch PowerShell by searching for “PowerShell” in the Start menu
  • or by pressing Win + X and selecting “Windows PowerShell”
  • open “Windows PowerShell (Admin)”.

Run the command: In the PowerShell window, run the following command:

Powershell code:

Resolve-DnsName -Name example.com

Replace “example.com” with the actual domain you want to check. This command will query the DNS records for the specified domain.

View the results:

The command will display the DNS records associated with the domain.

The output will include information like the record type, record name, TTL (Time to Live), and the corresponding IP address or other data.

Here’s an example of the output you might see:

Name Type TTL Section IPAddress
—- —- — ——- ———
A     3600   Answer 192.0.2.123
MX 3600   Answer 10 mail.example.com
NS  86400 Answer ns1.example-dns.com
NS  86400 Answer ns2.example-dns.com

This output indicates that the domain “example.com” has an A record pointing to the IP address 192.0.2.123, an MX record specifying the mail server as “mail.example.com,” and two NS records specifying the authoritative name servers as “ns1.example-dns.com” and “ns2.example-dns.com.”

By using the Resolve-DnsName cmdlet with the appropriate domain name, you can obtain the DNS records for any domain.

 

If you want to see our learning about this topic, you can click here

 

PowerShell (DNS Record)

PowerShell (Install Calculator)

PowerShell (Install Calculator)

To install the Windows 10 calculator using PowerShell, you can follow these steps:

  • Open PowerShell :
  • Press the Windows key,
  • type “PowerShell,” and click on “Windows PowerShell” in the search results.
  • Make sure to run PowerShell as an administrator.

Run the following command to install the Windows Calculator app from the Microsoft Store:

PowerShell code:

Get-AppxPackage -Name Microsoft.WindowsCalculator | Add-AppxPackage

 

Wait for the command to execute. It will download and install the Windows Calculator app from the Microsoft Store.

Once the installation is complete, you can close PowerShell.

After following these steps, you should have the Windows 10 calculator app installed on your system. You can find it by searching for “Calculator” in the Start menu or by looking in the “All Apps” list.

 

If you want to see our learning about this topic, you can click here

 

PowerShell (DNS Record)

PowerShell (Shutdown-Restart)

PowerShell (Shutdown-Restart)

PowerShell is a platform that consists of a command line, a programming language, and a configuration manager. You can run it on Windows, Linux, and MacOS. With it, we can do the things that we do graphically in Windows with the command line. in this learning, we want to know, how we can use Shut down or Restart computer by command. let’s start PowerShell (Shutdown-Restart).

First, we open it from the Start menu.

This command will shut down computer as Force without any confirmation:

when we use this command, system will shut down without any confirmation, this command is useful when you want to shut down immediately, we dont have any option to set time, when we use -Force

  • Stop-Computer -Force
Syntax:
  • Stop-Computer [-WsmanAuthentication <String>] [[-ComputerName] <String[]>] [[-Credential] <PSCredential>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
let’s to see video from our YouTube channel

This command shut down computer and ask for confirmation:

With this command we get a message to confirm shutdown, this command allows us to decide before shutdown. we can select to close all or select to close one by one.

  • Stop-Computer -Confirm

with option Yes ↓

Option Yes to All ↓

If you want to Restart your computer, you can directly use this command:

This command helps us to restart computers. in this action computer restart immediately and we dont have any option to delay.

  • Restart-Computer
Syntax:
  • Restart-Computer [-WsmanAuthentication <String>] [[-ComputerName] <String[]>] [[-Credential]<PSCredential>] [-Force] [-Wait] [-Timeout <Int32>] [-For <WaitForServiceTypes>] [-Delay <Int16>] [-WhatIf] [-Confirm] [<CommonParameters>]

If you want to Restart your computer with Delay, you can use these commands.

This is an effective way to choose restart computer with delay. In this action we have the option to select the time to Restart.

Note: In this tutorial, Time selected by Second

Syntax:
  • Start-Sleep [-Seconds] <Double> [<CommonParameters>]
  • Start-Sleep -seconds <Int32> [<CommonParameters>]
  • Start-Sleep -Duration <TimeSpan>[<CommonParameters>]

 

  • Start-Sleep -Seconds 5; Restart-Computer

If you want to see our learning about this topic, you can click here