Chirag Nagrekar has Published 465 Articles

How to use a variable inside a Foreach-Object Parallel?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:57:13

3K+ Views

There are two different types of the variable we can use inside foreach parallel loop. One that is declared inside and the other that is declared outside of the foreach parallel loop.Please note − We are discussing here Foreach-Object Parallel loop, featured in PowerShell version 7. For a normal foreach ... Read More

How to use Wait-Process in Powershell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:55:46

1K+ Views

Wait-Process cmdlet in PowerShell is used to wait for the process to stop before the execution moves on to the next step.ExampleWe have a snipping tool application running and we need to wait for the process to stop first and then move on to the next step.PS C:\> Get-Process SnippingTool ... Read More

How to use the Timeout command in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:53:14

16K+ Views

Timeout.exe is actually a cmd command which can also be used in PowerShell. Let see the help related to Timeout command.timeout /?If we see the timeout parameters list we can use /T which indicates the Time in seconds and /NoBreak command, which Ignores any key for the specified time.ExampleWrite-Output "Timeout is for 10 ... Read More

How to send email using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:51:23

3K+ Views

To send email using PowerShell, there are multiple methods but there is a simple command called SendMailMessage. This command is a part of the module called Microsoft.PowerShell.UtilityTo send email using the specific SMTP server we need to add the SMTP server parameter.Send-MailMessage `    -From 'User1@TestDomain.com' `    -To 'User2@TestDomain.com' ... Read More

How to retrieve Azure VMs using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:49:13

583 Views

To retrieve the azure VMs using PowerShell, we can use Get-AzVM commands but before that make sure you logged in using Azure Credentials in the console. When you type this command, you will get the list of all VMs in the specified subscription.To check which all properties are supported you ... Read More

How to Install Azure PowerShell Cmdlets?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:47:50

576 Views

Before Installing the Azure cmdlets for PowerShell, it is recommended to upgrade it to the PowerShell version 7.X to leverage the new features.To install the PowerShell cmdlets for Azure, you need to download and install the AZ module.Install-Module -Name Az -AllowClobber -Scope CurrentUserTo install it for all the users, Install-Module ... Read More

How to connect Azure Account using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 04-Jan-2021 09:46:43

3K+ Views

To connect the azure account with PowerShell, we can use the Connect-AZAccount command. If we check the command parameters from the below URL, there are multiple methods we can connect to the azure account but in this article, we will use the simple methods to connect.Using the Interactive console to ... Read More

How to check if the computer is connected to a domain using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 28-Dec-2020 07:03:41

13K+ Views

To check if a computer is connected to any domain we can use multiple methods. In this article, we can use two methods. One using the System Information of the computer and the second using the DirectoryServices .Net Class.First method using System Information and filter out a string called “Domain” ... Read More

How to Remove the computer from the AD domain using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 28-Dec-2020 07:01:58

2K+ Views

To remove the computer from the domain we need to use the Remove-Computer command.Remove-Computer -ComputerName Test1-win2k16 `                 -UnjoinDomainCredential Labdomain\Administrator `                 -WorkgroupName WG -Restart -Force -PassThruIn the above example, the Computer name Test1-Win2k16 is going to remove from ... Read More

How to Join Computer to the AD domain using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 28-Dec-2020 07:00:56

2K+ Views

To join any workgroup computer in the domain using PowerShell, we can use the Add-Computer command but before that, there are a few Windows prerequisite that DNS must be configured properly and the domain controller should be reachable and others should suffice then only PowerShell can use the command to ... Read More

Advertisements