10 PowerShell commands every Windows admin should know HD

18.07.2016
10 PowerShell commands every Windows admin should know SkillShare Course - Powershell Script Learn Weekly https://shorturl.at/pvwK4 Skillshare Free Course Grab 2 months Free Access as well Powershell Full Hands on Course : https://aikitsupport.com/courses/learn-powershell-step-by-step-hands-on-examples/ 1: Get-Help The first PowerShell cmdlet every administrator should learn is Get-Help. You can use this command to get help with any other command. For example, if you want to know how the Get-Process command works, you can type: Get-Help -Name Get-Process and Windows will display the full command syntax. You can also use Get-Help with individual nouns and verbs. For example, to find out all the commands you can use with the Get verb, type: Get-Help -Name Get-* 2: Set-ExecutionPolicy Although you can create and execute PowerShell scripts, Microsoft has disabled scripting by default in an effort to prevent malicious code from executing in a PowerShell environment. You can use the Set-ExecutionPolicy command to control the level of security surrounding PowerShell scripts. Four levels of security are available to you: Restricted — Restricted is the default execution policy and locks PowerShell down so that commands can be entered only interactively. PowerShell scripts are not allowed to run. All Signed — If the execution policy is set to All Signed then scripts will be allowed to run, but only if they are signed by a trusted publisher. Remote Signed — If the execution policy is set to Remote Signed, any PowerShell scripts that have been locally created will be allowed to run. Scripts created remotely are allowed to run only if they are signed by a trusted publisher. Unrestricted — As the name implies, Unrestricted removes all restrictions from the execution policy. You can set an execution policy by entering the Set-ExecutionPolicy command followed by the name of the policy. For example, if you wanted to allow scripts to run in an unrestricted manner you could type: Set-ExecutionPolicy Unrestricted 3: Get-ExecutionPolicy If youre working on an unfamiliar server, you ll need to know what execution policy is in use before you attempt to run a script. You can find out by using the Get-ExecutionPolicy command. 4: Get-Service The Get-Service command provides a list of all of the services that are installed on the system. If you are interested in a specific service you can append the -Name switch and the name of the service (wildcards are permitted) When you do, Windows will show you the services state. 5: ConvertTo-HTML PowerShell can provide a wealth of information about the system, but sometimes you need to do more than just view the information onscreen. Sometimes, its helpful to create a report you can send to someone. One way of accomplishing this is by using the ConvertTo-HTML command. Get-Service | ConvertTo-HTML -Property Name, Status C:services.htm 6: Export-CSV Just as you can create an HTML report based on PowerShell data, you can also e

Похожие видео

Показать еще