POWERSHELL BASICS. BACKGROUND  Powershell is a task automation and scripting language based off the.NET framework  It provides the user full access.

Slides:



Advertisements
Similar presentations
Copyright © 2011 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. SQL Workshop Day 4.
Advertisements

Jason Himmelstein, MVP Senior Technical Director,
James Boother Blog: INTRODUCTION TO POWERSHELL.
Automating Tasks With Macros
11 WORKING WITH GROUPS Chapter 7. Chapter 7: WORKING WITH GROUPS2 CHAPTER OVERVIEW  Understand the functions of groups and how to use them.  Understand.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 4: Implementing and Managing Group and Computer Accounts.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 4: Implementing and Managing Group and Computer Accounts.
Guide To UNIX Using Linux Third Edition
Managing Active Directory with PowerShell JOSEPH MOODY.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 8 Introduction to Printers in a Windows Server 2008 Network.
Basic.  PS is a command line interpreter/scripting environment  Designed for.Net  Similar to C#  Easy to instantiate.Net classes  Standardized syntax.
Daniel Petri MVP, Microsoft Infrastructure Manager John Bryce Training November 2007.
Technical Overview. PLEASE READ (hidden slide) To deliver this presentation effectively, you need to be familiar with Windows Server 2008 R2 management.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
WIN-B331 Get a consistent, personal Windows experience that matches your unique work style Easy for IT to deliver personal, user-defined experiences.
Using Linux Commands 2 Lab#5
Chapter 7 WORKING WITH GROUPS.
Adding a Module The Import-Module cmdlet  Can be used to load any external module into PowerShell.  Uses the following syntax to add the ActiveDirectory.
Microsoft ® Official Course Module 4 Automating Active Directory Domain Services Administration.
Using Linux Commands 2 Lab#5. Sort command Sort the lines of text files. $ sort fileName by default it will sort in normal order(alphabetical 0-9 A-Z.
Digital Image Processing Lecture3: Introduction to MATLAB.
Module 1: Installing Active Directory Domain Services
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
Hands-On Microsoft Windows Server 2008 Chapter 1 Introduction to Windows Server 2008.
Presenters: Winfred Wangeci Jignash Reddy.  It is Microsoft's new task-based command- line shell and scripting language designed especially for system.
Batch Files and Scripts Vic Laurie PPCUG June 9, 2003.
MS WINDOWS POWER SHELL CSE 535 Operating Systems.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Chapter 7: WORKING WITH GROUPS
Windows PowerShell Deep Dive 1 Morgan Simonsen Ementor.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
PowerShell Basics. o PowerShell is a great way to manipulate server and/or workstation components o It’s geared toward system administrators by creating.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Appendix A Starting Out with Windows PowerShell™ 2.0.
Module 3: Configuring Active Directory Objects and Trusts.
Exploring an Open Source Automation Framework Implementation.
Introduction to Windows PowerShell DANIEL HIBBERT PRIMER FIELD ENGINEER DMVMUG User Conference 2013 – Reston, VA.
Good Morning and Thank You!.  Have some Fun!  Learn at least one thing new!  Make myself available to you So please …  Ask questions and enjoy!
Functions CS 103. Review A function is a set of code we can execute on command to perform a specific task When we call a function, we can pass arguments.
Module 1: Configuring Windows Server Module Overview Describe Windows Server 2008 roles Describe Windows Server 2008 features Describe Windows Server.
Agenda Getting Started: Using Unix Unix Structure / Features Elements of the Unix Philosophy Unix Command Structure Command Line Editing Online Unix Command.
Operating Systems Concepts 1/e Ruth Watson Chapter 3 Chapter 3 DOS Ruth Watson.
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
Section 4: Understanding the Architecture of Group Policy Processing Group Policy Components in AD DS Understanding the Group Policy Processing Sequence.
Module 5: Creating and Configuring Group Policies.
Shell Scripting – Putting it All Together. Agenda Escaping Characters Wildcards Redirecting Output Chaining and Conditional Chaining Unnamed and Named.
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
CIS 1402: Intro to CIS Tom Gustafson. Facts About PowerShell PowerShell is Microsoft’s command-line interface that provides scripting and management capability.
Innovation Intelligence ® 1 Chapter 4: Using TCL to Control the HyperMesh Session.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Windows PowerShell. What is Windows PowerShell? A command-line interface (CLI) A new way of developing Windows and other products to be more manageable.
Microsoft ® Official Course Module 4 Automating Active Directory Domain Services Administration.
Module 6 Creating and Configuring Group Policy. Module Overview Overview of Group Policy Configuring the Scope of Group Policy Objects Evaluating the.
Lab 1 Writing Interactive Queries CISB514 Advanced Database Systems.
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
 Version 1.0[edit]edit  Version 1.0 was released in 2006 for Windows XP SP2/SP3, Windows Server 2003,
Ravikanth C.
Building Powerful Workflow Automation with Cherwell and PowerShell
How to inventory Windows installed software
Python Lesson 12 Mr. Kalmes.
PowerShell Introduction Copyright © 2016 – Curt Hill.
CTEC 111 PowerShell Fundamentals
Microsoft - Managing Office 365 Identities and Requirements
Automating AD Administration with Windows PowerShell
Python Lesson 12 Mr. Kalmes.
PowerShell goodness 2017 Jeremy Sublett Composable Systems, LLC
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
PowerShell Best Practices for SQL DBA’s
Executing Host Commands
Presentation transcript:

POWERSHELL BASICS

BACKGROUND  Powershell is a task automation and scripting language based off the.NET framework  It provides the user full access to the COM (Component Object Model) and WMI (Windows Management Instrumentation)  The functions (lightweight commands) that PowerShell utilizes to complete certain tasks are called cmdlets (command-lets)

BACKGROUND (CONTINUED)  Cmdlets are not standalone executables; they are instances of.NET framework classes  PowerShell syntax is case insensitive

FIRST SCRIPT  Suppose you wanted to query a list of currently running processes on a system. The following command will do just that:  Get-Process  To sort the list of processes, use the pipeline ` | ` to pass the output to the Sort-Object cmdlet (or Sort)  You can select certain fields of the output by piping the output and passing it using select

FIRST SCRIPT (RUNNING THE SCRIPT)  There are various ways a PowerShell script can be run  Command line  Type in the path of the script  If the current directory is the same as the script, the filename must be preceded with “.\” or “./”  File Explorer

FIRST SCRIPT (RUNNING THE SCRIPT)  Based on the ExecutionPolicy setting on the system, this may need to be overridden in order to be able to run scripts  To change this setting, you must be an administrator  You can bypass this setting without actually changing the setting by writing a one-line batch file that calls PowerShell to run the script using certain arguments

ACTIVE DIRECTORY  PowerShell, being native to the Windows environment, is a powerful language to use when interacting with AD objects  The user can process information more quickly than some GUI utilities

ACTIVE DIRECTORY (EXAMPLES)  Query all AD users in the domain:  Get-ADUser –Filter *  Get AD users based on a filter:  Get-ADUser -Filter 'name -like "parsa*“’  Notice the wildcard at the end of the filter  Filter users based on department:  Get-ADUser –Filter ‘office –like “* *”’

ACTIVE DIRECTORY (EXAMPLES, CONTINUED)  You can query AD computer objects that have been created or modified by a certain date  $d = (Get-Date).addDays(-1)  Variable $d is assigned the value of one day before the current date

UPDATING COMPUTER SCRIPT ./updateWorkstation.bat ./updateWorkstation.ps1

GET AD COMPUTERS WHEN CREATED SCRIPT ./getComputerModBy.bat ./getComputerModBy.ps1

BACKUP USERS SCRIPT ./backup.bat ./backup.ps1

GET COMPUTER NAME AND RAM SCRIPT ./getComputerName.bat ./getComputerName.ps1

SOURCES  tasks-solved-powershell tasks-solved-powershell 