PowerShell is the de facto standard for scripting in Microsoft Windows environments. By knowing how to use PowerShell, system administrators can quickly automate complex, repetitive, and otherwise time-consuming tasks.
This video course will help you to master automation and finish the course by building a variety of PowerShell scripts to automate your environment and reduce the amount of code required. Through real-world examples, you will learn how to simplify managing your Windows environment and then effectively administer Windows-based systems and environments by using advanced functions.
You will gain a strong foundation to advance your existing PowerShell knowledge through real-world scenarios. By the end of this course, you will be able to quickly produce scripts that can be run in your existing environments, and perform and automate tasks by building scripts that involve systems and enterprise management.
You will finish the course by getting a thorough understanding of how to use advanced features to work with Active Directory and the file system, and will deploy tried and tested scripts for a variety of management tasks.
About the Author
Heiko Horn started out as technician and worked his way into computing and programming as his focus, and life orientation shifted. He has experience with various operating systems and has been working with PowerShell for the past 10 years. He became interested in this scripting language as a means of minimizing workload by automating several steps and therefore saving time. His job involves several changes throughout the year; adding or changing only a couple of aspects within a PowerShell script frees up time for other tasks he faces as a System Administrator.
Before you dive deep into each topic, let's take a look at the new features available in Windows PowerShell 5.
Just knowing the new features is no fun, so let's run a few and see how they work.
Take a tour through a few more new features that will make your life much easier.
Securing passwords is an important aspect that shouldn't be ignored. Automating tasks will require your passwords; however, you need to ensure that these passwords and privileges are not misused.
Let's use the Windows Registry and make the best of what it has to offer. The Windows Registry enables us to store some preferences as default ones, saving a lot of manual intervention.
PowerShell has got some neat cmdlets that easily let you create HTML from an object that you could use to e-mail easy-to-read and neatly formatted information.
We'll take a look at the global error object variable, and know that this is your best friend when debugging your PowerShell code.
Actions that need to be taken post an error is observed can be controlled. We'll see a few options to use them in our favor.
Let's create a try, catch, and finally block for every cmdlet that could potentially cause an exception.
Learn to write events to the event log that can be viewed with the Event Viewer or even better be picked up by a Network Monitoring System
You will want to make sure that your automated task will notify you of the error exception that was thrown while it was executing your PowerShell script. We'll implement e-mail notification for this purpose
Debugging PowerShell is an essential part in writing a successful script; using color will help to spot abnormal behavior.
Use PowerShell to interact with the Windows file system.
Set access control lists on files and directories.
Use PowerShell cmdlets to get the content of a file. Manipulate files in various ways.
Create comma-separated files using PowerShell objects and create PowerShell objects from comma-separated files.
Do a complex file manipulation using PowerShell.
Use PowerShell to find files that are taking up an enormous amount of disk space.
Use PowerShell to find hidden files with a specific character or by wildcard characters and delete them.
Use PowerShell SQL cmdlet without having the modules or the Microsoft SQL Server tools installed on your computer.
Interact with Microsoft SQL Server using PowerShell.
Install MySQL PowerShell components to be able to interact with a MySQL server.
Execute MySQLData Definition Language (DDL) and Data Manipulation Language (DML) statements on a MySQL server using PowerShell.
PowerShell has got some neat cmdlets that easily let you create XML from an object, import objects from XML, and export objects to XML.
PowerShell has got some neat cmdlets that easily let you create JSON from an object or import JSON into a PowerShell object.
Use the PowerShell SQL cmdlet without having the modules or the Microsoft SQL Server tools installed on your computer.
Use the Active Directory Powershell module to create, modify, enable, disable, and delete AD user objects.
Add Active Directory memberships to an Active Directory user object using the AD PowerShell module.
Use the Active Directory PowerShell module to create placeholder computer objects, remove computer objects, or find the computer a specific person is logged on to.
Create, modify, or delete Organizational Units and filter user or computer objects by Organizational Units.
Automate the creation of Active Directory user accounts.
Automate the synchronization ofActive Directoryusers'accounts.
Automate the deletion of Active Directory users' accounts.
Automate the deletion of Active Directory computer objects.
Create IPv4 and IPv6DHCP Scopes. Create IPv4 and IPv6 Failover Scopes. Set DHCP exclusion ranges, reservations, and server options for IPv4 and IPv6. Create Vendor Classes, define options for these classes, and associate these options with a DHCP scope.
Use PowerShell to create a primary DNS server zone. Create A and AAAA records with pointer records. Modify A records and their associated pointer records. Create alias records. Use PowerShell to automate the creation of DNS records from a CSV file.
Use PowerShell to automate the creation of printer objects using a CSV file.
Use PowerShell to automate the deletion of fast-growing log files.
Present data in an easy to read manner that anyone could understand.
Use PowerShell to interact with Win32 Classes.
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.