Enterprise PowerShell Scripting Bootcamp
eBook - ePub

Enterprise PowerShell Scripting Bootcamp

  1. 238 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Enterprise PowerShell Scripting Bootcamp

Book details
Book preview
Table of contents
Citations

About This Book

The quick start guide for an advanced enterprise PowerShell frameworkAbout This Book• Introduces industry-proven techniques that improve script efficiency and reliability• Example-rich guide based on real-world scenarios• Facilitates building a script that can fully scan a Windows server and identify componentsWho This Book Is ForThis book is for IT professionals and Windows administrators who would like to gain intensive, hands-on knowledge and skills on PowerShell without spending hours and hours in learning. If you have been struggling to find the time to gain proficiency and confidence with PowerShell and everyday scripting tasksWhat You Will Learn• Create an advanced PowerShell scripting template that provides repeatable code to jumpstart all of your scripting projects• Learn how to securely encrypt and store usernames, passwords, and other sensitive data in PowerShell scripts and answer files• Understand how to optimize the performance of scripts to help process large datasets quickly and avoid time-consuming mistakes• Develop a script to scan for non-standard Windows Server configurations and identify service accounts used on Windows Servers• Gather a large list of data from a Windows server without locally or remotely logging in interactivelyIn DetailEnterprise PowerShell Scripting Bootcamp explains how to create your own repeatable PowerShell scripting framework. This framework contains script logging methodologies, answer file interactions, and string encryption and decryption strategies.This book focuses on evaluating individual components to identify the system's function, role, and unique characteristics. To do this, you will leverage built-in CMDlets and Windows Management Instrumentation (WMI) to explore Windows services, Windows processes, Windows features, scheduled tasks, and disk statistics. You will also create custom functions to perform a deep search for specific strings in files and evaluate installed software through executable properties.We will then discuss different scripting techniques to improve the efficiency of scripts. By leveraging several small changes to your code, you can increase the execution performance by over 130%.By the end of this book, you will be able to tie all of the concepts together in a PowerShell-based Windows server scanning script. This discovery script will be able to scan a Windows server to identify a multitude of components.Style and approachThis book is all about fast and intensive learning. This means, we don't waste time in helping readers get started. The new content is about leveraging highly-effective examples to build new things, help solving problems in newer and unseen ways, and providing an enterprise-ready platform to create PowerShell Scripts.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Enterprise PowerShell Scripting Bootcamp by Brenton J.W. Blawat in PDF and/or ePUB format, as well as other popular books in Informatique & Administration du système. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781787281158

Enterprise PowerShell Scripting Bootcamp


Table of Contents

Enterprise PowerShell Scripting Bootcamp
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Enterprise PowerShell Scripting
Windows server scanning script
Performance considerations
PowerShell scripting templates
Summary
2. Script Structure, Comment Blocks, and Script Logging
Overall script structure
Comment blocks
Script logging
Creating the logging files
Creating a windows event log source
Creating the logging function
Summary
3. Working with Answer Files
Answer files
XML answer files
Reading XML answer files
XML tag function
Summary
4. String Encryption and Decryption
RijndaelManaged encryption
Creating random salt, initialization vector, and passwords
Encrypting and decrypting strings
Decrypting strings
Securing the password
Decryption with encoded password
Summary
5. Interacting with Services, Processes, Profiles, and Logged on Users
Windows services
Managing Windows processes
Identifying logged on users
User profiles
Summary
6. Evaluating Scheduled Tasks
Scheduled tasks
Identifying scheduled tasks running as alternate users
Summary
7. Determining Disk Statistics
Disk statistics
Retrieving physical and logical disk information
The DriveType property
Converting disk space to MB and GB
Free Space property
Disk information script
Summary
8. Windows Features and Installed Software Detection
Windows features
Installed software detection
Scanning executables in \Program Files
Summary
9. File Scanning
File scanning
Excluding long paths
Excluding files
Summary
10. Optimizing Script Execution Speed
Script execution speed
Speed considerations for the write-host cmdlet
Speed considerations for the write-progress cmdlet
Speed consideration - switches versus if statements
Summary
11. Improving Performance by Using Regular Expressions
Using regular expressions
Dynamically building expressions
Implementating regular expression performance
Summary
12. Overall Script Workflow, Termination Files, and Merging Data Results
Windows server scanning script overview
Pre-script security
Script 1 - randomized password and string generator
Script 2 - string encryption script
XML answer file creation
PowerShell script 3 - the termination files
PowerShell script 4 - merging the scanning script result data
Summary
13. Creating the Windows Server Scanning Script and Post-Execution Cleanup
Windows server scanning script creation
Comment block
Parameter block
Answer file reading function
Decryption function
Populating script answers in variables and arrays
Creating the log files and logging function
Creating a termination function
Multiple Windows server scanning script functions
Scheduled tasks function
Windows processes function
Windows services function
Installed software function
User profiles function
Windows features function
Scan files and folders function
Invoking the functions
Running the script
Performing script cleanup
Summary
Index

Enterprise PowerShell Scripting Bootcamp

Copyright © 2017Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May2017
Production reference: 1160517
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B32PB, UK.
ISBN 978-1-78728-828-7
www.packtpub.com

Credits

Author
Brenton J.W. Blawat
Reviewer
Tim Amico
Commissioning Editor
Kartikey Pandey
Acquisition Editor
Namrata Patil
Content Development Editor
Amrita Noronha
Technical Editor
Jovita Alva
Copy Editors
Safis Editing
Laxmi Subramanian
Project Coordinator
Shweta H Birwatkar
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Graphics
Tania Dutta
Production Coordinator
Nilesh Mohite
Cover Work
Nilesh Mohite

About the Author

Brenton J.W. Blawat is an entrepreneur, strategic technical advisor, multi-published author, and enterprise architect who has a passion for the procurement of technology in profit-based organizations. Brenton is business-centric, while technology minded, and has many years of experience bridging the gap between technical staff and decision makers in organizations. He takes pride in his ability to effectively communicate to a diverse audience and provide strategic direction for large and small organizations alike.
Since 2013, he has authored and published multiple books with Packt Publishing, including:
  • PowerShell 3.0 WMI Starter
  • (Co-authored) PowerShell: Automating Administrative Tasks
  • Mastering Windows PowerShell Scripting
Brenton currently works at CDW as an enterprise architect in Strategic Solutions and Services. CDW is a leading mul...

Table of contents

  1. Enterprise PowerShell Scripting Bootcamp