MS WINDOWS POWER SHELL CSE 535 Operating Systems.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
The Web Warrior Guide to Web Design Technologies
Languages for Dynamic Web Documents
Server-Side vs. Client-Side Scripting Languages
1 Chapter 12 Working With Access 2000 on the Internet.
James Boother Blog: INTRODUCTION TO POWERSHELL.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Guide To UNIX Using Linux Third Edition
Managing Active Directory with PowerShell JOSEPH MOODY.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Basic.  PS is a command line interpreter/scripting environment  Designed for.Net  Similar to C#  Easy to instantiate.Net classes  Standardized syntax.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Welcome Course 20410B Module 0: Introduction Audience
1 Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET201.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
2440: 141 Web Site Administration Remote Web Server Access Tools Instructor: Enoch E. Damson.
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
Lesson 4 Computer Software
INTRODUCTION TO WEB DATABASE PROGRAMMING
© 2007 Asynchrony Solutions, Inc. 1 10/29/07 Introduction to PowerShell Brian Button VP Engineering Asynchrony Solutions, Inc
Presenters: Winfred Wangeci Jignash Reddy.  It is Microsoft's new task-based command- line shell and scripting language designed especially for system.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
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.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Appendix A Starting Out with Windows PowerShell™ 2.0.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Tutorial 10 Programming with JavaScript
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based.
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!
Module 1: Configuring Windows Server Module Overview Describe Windows Server 2008 roles Describe Windows Server 2008 features Describe Windows Server.
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
PowerShell For SharePoint Developers Neil Iversen Inetium
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
 An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is.
CIS 1402: Intro to CIS Tom Gustafson. Facts About PowerShell PowerShell is Microsoft’s command-line interface that provides scripting and management capability.
POWERSHELL BASICS. BACKGROUND  Powershell is a task automation and scripting language based off the.NET framework  It provides the user full access.
BIF713 Operating System Concepts MS Windows. Agenda 1. What is an Operating System (definition)? 2. Types of Operating Systems 3. Basic Operations: –
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
1 Sneak Preview to Windows Key Areas of Focus of Windows 2008 Improvements in Server Security New Terminal Services capabilities Network Access.
 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.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
ASP Syntax Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
 Version 1.0[edit]edit  Version 1.0 was released in 2006 for Windows XP SP2/SP3, Windows Server 2003,
Windows Certification Paths OR MCSA Windows Server 2012 Installing and Configuring Windows Server 2012 Exam (20410) Administering Windows Server.
Ravikanth C.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
PowerShell Introduction Copyright © 2016 – Curt Hill.
Operating System Concepts
Introduction to ASP By “FlyingBono” 2009_01 By FlyingBono 2009_01
Web Application Development Using PHP
Presentation transcript:

MS WINDOWS POWER SHELL CSE 535 Operating Systems

What is Power Shell PowerShell is Microsoft Windows’ object-oriented programming language interactive command line shell PowerShell designed to ◦ automate system tasks:  such as batch processing ◦ create systems management tools ◦ for commonly implemented processes

What is it for? Perl The PowerShell language is similar to Perl. PowerShell includes ◦ more than 130 standard command line tools ◦ for functions that formerly required users VBVBScriptC#  to create scripts in VB, VBScript or C#.

Where to Download? s.aspx?FamilyID=50633a1f-a d- 923c-1a269f8ac084&displayLang=en s.aspx?FamilyID=50633a1f-a d- 923c-1a269f8ac084&displayLang=en

Cmdlet Windows PowerShell Cmdlet Cmdlet Cmdlet (or Command-let) ◦ which.NET objects can be accessed  from the command line. ◦ A Cmdlet name consists of two elements:  a verb and a noun Example: ◦ one of the most useful Cmdlets:  Get-help

Automating Tasks PowerShell offers ways ◦ to automate tasks: Cmdlets: ◦ very small.NET classes.NET ◦ appear as system commands Scripts: ◦ combinations of cmdlets and associated logic. Executables: ◦ standalone tools Instantiation of standard.NET classes.

Integrating with.NET PowerShell integrates with the.NET environment Can be embedded within other applications. Over a hundred cmdlets are included to be used separately or combined with others to automate more complex tasks Users can also create and share cmdlets.

Abbreviations for Cmdlets there are abbreviations ◦ for some of the Cmdlets, for example:Get-Process Can also be typed as:ps

Linux-similar Cmdlets “ps” ◦ is command familiar to Linux users ◦ as the command  to view details about currently running processes. there are a number of ◦ other Linux-PowerShell parallels: “man” is the same as “Get-Help –detailed” “ls” is the same as “Get-ChildItem” “pwd” is the same as “Get-Location”

Understanding Aliases PowerShell commands are usually long. ◦ example: Get-ChildItem. However, PowerShell has aliases. ◦ Example: ◦ “dir” is the same as “Get-ChildItem”get-alias get-alias dir

Obtaining PowerShell PowerShell is installed in Windows Server 2008 is also part of Windows 7, it does not come ready loaded with XP or Vista!

Running PowerShell Once PowerShell has been installed ◦ then it can be run in two ways: Click on “Start”, “Run” ◦ and then type in “powershell” Start a new command prompt ◦ and then type in “powershell” the user can start using ◦ the PowerShell commands.

Cmdl: ps ps One very useful Cmdlet is ps ◦ or get-process lists the currently running processes ◦ the number of memory page (frame)s ◦ the percentage of processor usage

Pipe and Sort The list is sorted alphabetically ◦ according to the process name. You can sort WS field ◦ According to the memory usage To do this the user ◦ “pipes” the output of ps ◦ to a second Cmdlet “sort-object” ps | sort-object WS –descending

Sorting wrt Memory Usage

Filtering & Splitting the Commands User can filter that ◦ the “powershell” not to be seen in output  Add a filter piped Cmdlets can be ◦ split over multiple lines: ps | where-object –FilterScript {$_.processname -ne "powershell"} | sort-object WS –descending

Filtered

To concatenation symbol The concatenation symbol (>) ◦ will send the result output file ◦ after the information has been converted to HTML ◦ so that it can then be viewed in a web browser: ps | where-object -FilterScript {$_.processname -ne "powershell"} | sort-object WS –descending | convertto-html -property Name, WS > ps.html

Displaying in Browser

Find all the processes on a computer that started today Get-Process | Where {$_.starttime -ge [datetime]::today}

Find the processes that use more than 1000 MB of memory and kill them get-process | where-object { $_.WS -gt 1000MB } | stop-process -whatif

Calculate the number of bytes in the files in a directory get-childitem | measure-object -property length -sum

Defining Variables $a = 5 PS C:\> $a = 5 $a PS C:\> $a 5 PS C:\>

Determine Variable $a.GetType() PS C:\> $a.GetType()

Piped Commands dir | sort LastWriteTime | more

$a = dir | sort LastWriteTime PS C:\WINDOWS> $a = dir | sort LastWriteTime $a[0] PS C:\WINDOWS> $a[0] $a[1] PS C:\WINDOWS> $a[1]