Microsoft Technologies Articles

Page 162 of 175

Windows 8 task managers running process

Samual Sam
Samual Sam
Updated on 07-Jul-2020 418 Views

If, you are finding a tool should be best to hold the overall PC’s performance. The Windows Task Manager is a great one.Task Manager is a task management and monitoring tool, shows the current status of programs, processes, and services run on Windows operating system. It comes in use to monitor the performance of the applications/services run on the system and to stop the applications/services that troubles the system performance.Over the internet, Task Manager can display the network status; means; how the network is functioning with other devices and users. Also, displays how many users are connected to the system, ...

Read More

How to deploy windows deployment services on server 2012 r2

Samual Sam
Samual Sam
Updated on 07-Jul-2020 2K+ Views

What is WDS?Windows Deployment Services allows you to deploy windows operating systems on your client machines.Suppose you have 200 machines on your network and you would like to install Windows 10 on them. You can configure WDS and network boot those machines without installing windows separately using CD or DVD.Deployment ScenarioThere are many WDS deployment scenarios. But for this tutorial, we are assuming WDS and DHCP which are installed on the same server (DHCP can also be running separately on some other Windows or Linux server machine).PrerequisiteMake sure that, your DHCP is already running with an active scope. Following are ...

Read More

How to create a User Menu in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 03-Jul-2020 4K+ Views

When you are writing a script and if you want to provide the user to select one option among multiple values and based on it to execute the command, we can generally use the Switch command and for it, we will ask the user choice in the below script.There is another .Net method to create a user menu, we will see it after the example from the description mentioned above.a. Switch command methodFor the Switch command-based user selection, we will first display the message for the user and then give him a choice for the selection through Read-Host command as ...

Read More

How to get website SSL certificate validity dates with PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 03-Jul-2020 12K+ Views

SSL certificates are a very crucial part of the website. They play a key role in securing the exchange of information on both client and server sides by activating an HTTPS secure connection. In the below article with the PowerShell, we will get the certificate validity date (starting and expiry date) for the certificate using PowerShell.To achieve this, we need to make httpwebrequest but before that, we will ignore SSL warning by the below command.[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }And then we wil make the HTTP web request by calling a .Net class.$url = "https://www.microsoft.com/" $req = [Net.HttpWebRequest]::Create($url)When we check the ...

Read More

Explain Try/Catch/Finally block in PowerShell

Chirag Nagrekar
Chirag Nagrekar
Updated on 06-Jun-2020 9K+ Views

Try/Catch block in PowerShell is to handle the errors which are produced in the script. To be specific, the errors should be terminating errors. The Finally block in the PowerShell is not mandatory to write each time along with Try/Catch but it will be executed regardless the error occurs or not.So when you use the Try block, the Catch block is mandatory but not Finally block.Try/Catch block with Terminating error − Below is the example of Terminating error without finally block.Exampletry{    This is not allowed    "This is Allowed" } catch{    Write-Host "Error occured" -BackgroundColor DarkRed }OutputPS C:\WINDOWS\system32> ...

Read More

How to use the ErrorActionPreference variable in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 27-May-2020 7K+ Views

ErrorActionPreference variable in PowerShell is to control the non-terminating errors by converting them to terminating errors. Error handling depends upon which value you assign to $ErrorActionPreference variable.The values are as below.Continue − This is the default value of the variable and when the error occurs, an error is displayed in the PowerShell console, and the script continues the execution.Get-WmiObject -Class Win32_Logicaldisk -ComputerName Nonexist Write-Host "Hello World"Output Get-WmiObject -Class Win32_Logicaldisk -ComputerName Nonexist Write-Host "Hello World" Get-WmiObject : The RPC server is unavailable. At line:2 char:1 + Get-WmiObject -Class Win32_Logicaldisk -ComputerName Nonexist + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException + FullyQualifiedErrorId ...

Read More

What is terminating and non-terminating errors in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 27-May-2020 2K+ Views

Powershell generates two types of errors when it executes script or commands. Terminating errors and Non-Terminating errors.Terminating error − This error generated by script, functions, or commands you create and it stops or halts the execution of the script so that the commands in the next lines can’t be executed. To handle this error proper mechanism is needed otherwise there would be an error message displayed.For example, PS C:\WINDOWS\system32>> This-commandnotexist This-commandnotexist : The term 'This-commandnotexist' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path ...

Read More

What is use of $error variable in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 27-May-2020 3K+ Views

Error variable in PowerShell is to view the errors generated in the current PowerShell session. We can say that the $Error variable is the container that stores all the errors and the latest error will be displayed first. For the example below, we will set the $Errorview to Category view to minimizing the error display content. By default $ErrorView is a Normal view.$ErrorView = "Categoryview"Now we will see the $error variable example, PS C:\WINDOWS\system32> asdds ObjectNotFound: (asdds:String) [], CommandNotFoundException PS C:\WINDOWS\system32> Get-process asddsd ObjectNotFound: (asddsd:String) [Get-Process], ProcessCommandExceptionHere, there is one wrong command and one wrong input we have written so ...

Read More

What is the use of Lastexitcode and ? Variable in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 27-May-2020 7K+ Views

$LastExitCode in Powershell is the number that represents the exit code/error level of the last script or application executed and $? (Dollar hook) also represents the success or the failure of the last command. In general, both represent the same but the output method is different. The first command output is in the Number format (0 and 1) and the latter command is for Boolean (True or False) output.For example, PS C:\WINDOWS\system32> $LASTEXITCODE 0 PS C:\WINDOWS\system32> $? TrueAs you see the output, 0 represents the success status of the $LastExitCode command and $True for the $?.Now if the command doesn’t ...

Read More

Explain secure password Encryption with PowerShell.

Chirag Nagrekar
Chirag Nagrekar
Updated on 16-May-2020 537 Views

Many times we need to use passwords in PowerShell and need to pass it to the credential parameter and a password should be always a secure string, not a plain text. There are few methods to encrypt the password as mentioned below.a) Get-Credential FormatWe have one method where we can store the username and password is through cmdlet Get-Credential. It will provide a GUI prompt. You can store this password into a variable and use it later in the command.$cred = Get-CredentialCredentials are stored into $cred variable. Here is the value of the variable. output below.PS C:\WINDOWS\system32> $cred UserName   ...

Read More
Showing 1611–1620 of 1,744 articles
« Prev 1 160 161 162 163 164 175 Next »
Advertisements