/images/avatar.png

Kamil Pro

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.

PowerShell for IT Professionals [#8] – Manage everything with PowerShell

Exercises Can you uninstall module that was installed with Install-Module? Confirm your answer with Get-Module -ListAvaiable Can you update the installed module? Perhaps, you’d like to install version 1.0.0.0 of SNMP module, how can you force Install-Module to do so? Install-Module error If you encounter the issue with downloading modules, run this commandlet as a temporary workaround (it must be applied every time the shell is restarted): [Net.ServicePointManager]::SecurityProtocol = [Net.

PowerShell for IT Professionals [#7] – Formatting output

Exercises Send output of any commandlet, e.g. get service to Printer Lesson notes 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 # So far, we've been using default PowerShell behaviour for formatting output # Although in the last lesson we did filtering data with Where-Object and Select-Object # We didn't really focus on how data is presented on the screen.

PowerShell for IT Professionals [#6] – Filtering output

Exercises List all services that are stopped List all service that are stopped and they name begins with W Display only the Display Name of services that stopped and their name begins with W Lesson notes 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ### Filtering # Some commands accept wild cards in the search or have a filter parameter Get-Service -Name w*,b* #But there's more universal method, based on property names Get-Service | Where-Object -Filter {$_.

PowerShell for IT Professionals [#5] – Providers

Exercises Create a folder in root of C: with the name of PowerShell Create a file inside the folder with the name of your choice and no content Retrieve all items from Env: drive Check the version of Notepad.exe in Windows directory Discover current Windows build version by registry property: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion Notes from the lesson 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 # Provider allows to access some data storage (e.