
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2039 Articles for Microsoft Technologies

2K+ 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 | Select Name, Id, CPU Name Id CPU ---- -- --- SnippingTool 7440 2.0625To wait for the process to stop first we will use the Wait-Process command. You can provide ProcessName or ID.Write-Output "Waiting for the Process to Stop" ... Read More

21K+ 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 seconds" Timeout /T 10 Write-Output "This line will be executed after 10 seconds if not interuptted"OutputPS C:\> C:\Temp\TestPS1.ps1 Timeout is for 10 seconds Waiting for 5 seconds, press a key to continue ...Please note: In the above example, the user can interrupt the timeout seconds using any key to disallow ... Read More

4K+ 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' ` -Subject 'Test Email' ` -SmtpServer 'Smtp.TestDomain.com'In the above example, an email will be sent from the -From parameter, a user to -To parameter users with the subject name ‘Test Email’ with the specified SMTP server name.If you have multiple users then you can separate them using a ... Read More

697 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 can use theGet-AzVM | gm -MemberType PropertiesYou can select different properties from there using the Select-Object command (Alias: Select). To retrieve the VMs from the specific ResourceGroup, use the below command.Get-AzVM -ResourceGroupName AUTOMATIONTESTRG2If your VM is in a different subscription then you need to switch the subscription and need to ... Read More

686 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 -Name Az -AllowClobber -Scope AllUsersIf the AzureRM module is already installed, you first need to uninstall it because both modules AzureRM and AZ cannot reside in the same console and the AzureRm module is going to decommission soon. So anyway we need to upgrade it to the latest AZ Module.To ... Read More

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 connect portalUsing DeviceLogin method.Using Credentials method.Using the Interactive console method to connect the portal.When we use the Connect-AZAccount directly without any parameter, it will open a popup for the azure portal credential.You need to enter your Azure credentials there.Using Device Login method.In this method, Connect-AZAccount uses the parameter -DeviceLogin. Once ... Read More

16K+ 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” which shows us if the computer is in the domain or the workgroup.systeminfo | findstr "Domain"OutputIf the computer is in the workgroup, It will show the workgroup name. For example, In the second method, we will use the directory service .Net class method name GetComputerDomain(). If the server is not connected to the ... Read More

3K+ 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 the domain with the domain credentials and it will be joined to WorkGroup named WG. If the system doesn’t restart due to any reason, you need to reboot the system manually.Here the computer name is the String[]. So you can provide multiple computers to remove from the domain. For example, Remove-Computer -ComputerName Test1-win2k16, ... Read More

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 join computer into a domain.Add-Computer -ComputerName Test1-win2k16 ` -DomainCredential Labdomain\Administrator ` -DomainName Labdomain.local -Restart -Force -PassThruOnce you run the above command, it will ask you for the credential for the user you entered. In the above example, we are joining a ... Read More

751 Views
To create a task using GUI (As shown below image) we need a few settings like the Name of the task, trigger, and Action.Similarly, to create a new task in task scheduler using PowerShell comprises of several settings.Name of the taskThe time when the task to triggerAction − Do we need to schedule a program for execution or send an email on some event trigger.Description − This is optional. You can add a description of the task.Registering task − Final step is to register the created task.Above all actions use different cmdlets but they are part of a ScheduledTasks module. To ... Read More