Kamil Procyszyn

PowerShell for IT Professionals [#14] – Scripting – Hello World!

In this lesson we will be preparing our workstation for writing PowerShell scripts. We will start by enabling RSAT and then install Visual Studio Code which is a recommended and free PowerShell code editor. We will then have a look at the basic function of VS Code and create a simple “Hello World” script. Exercises If you haven’t followed along, you definitely would like to install VS Code and create a *.

PowerShell for IT Professionals [#13] – Is PowerShell secure?

In this lesson we will have a look on PowerShell built in security features and how it differs from e.g. BAT files. We will then have a look how execution policy can help to control on what basis the PowerShell scripts can be executed. At the end, we will configure some GPOs to control the execution and transcription of scripts.

PowerShell for IT Professionals [#12] – WMI – Windows Management Instrumentation

In this lesson we learn how to use PowerShell to access WMI (Windows Management Instrumentation), so that we can gain often hidden or obscure information. We will then use WMI Explorer graphical tool to ease discovering all possible classes and instances that WMI provides. Finally, we will use WMI queries to add another level of granularity in GPO so that we can target very specific computers in it.

PowerShell for IT Professionals [#11] – Variables

In this lesson we’re going to learn how what Variables are, why it’s good to use them and how to actually create them. We will then assign various values to variables to and use them solely, and in parameters. We will also have a look at foreach loop so that we can e.g. ping multiple computers using single variable with multiple objects in it. Exercises Use Get-Command to find all commands that allow you to manage variables.

PowerShell for IT Professionals [#10] – Remote management with PowerShell

In this lesson we’re going to learn how to do one-to-one and one-to-many remote management with PowerShell. There’s no need for telnet, ssh or psexec as PowerShell has its own protocol that’s built in right into Windows. We will look at how to create interactive sessions and send commands to multiple servers at once. Exercises With Enter-PSSesion, Remote to remote server and  restart “Windows update” service With Invoke-Command find out the remote computers last boot up/startup time List all running processes on remote server without using Enter-PsSession or Invoke-Command If you have a Domain Controller available, use Invoke-Command to list all computers on that network (you can use * for filter), remember that you need to provide all necessary parameters with your command in the script block so command just runs and doesn’t prompt for any additional information.

PowerShell for IT Professionals [#9] – Setting up Active Directory

Exercises On domain controller, find module that allows to manage Active Directory List all the Active Directory users List members of “Enterprise Administrators” Find the feature name for Windows Server Backup and install it with PowerShell Commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ### Server # Check IP configuration # Show steps in Server how to install # Check hostname Hostname # Rename server Rename-Computer ps-svr1 # Restart computer Reboot-computer # Get-WindowsFeature # Install-WindowsFeature Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools Install-ADDSForest -DomainName posh.