# Demo: jak to działa?



Similar documents
Microsoft. Jump Start. M3: Managing Windows Server 2012 by Using Windows PowerShell 3.0

PowerShell for Exchange Admins

Jeffrey Snover Distinguished Engineer & Lead Architect Jason Helmick Senior Technologist, Concentrated Technology

WolfTech Active Directory: PowerShell

Exploring PowerShell. Using Windows PowerShell

SUNGARD SUMMIT 2007 sungardsummit.com 1. Microsoft PowerShell. Presented by: Jeff Modzel. March 22, 2007 Course ID 453. A Community of Learning

Introduction to PowerShell by Guy Thomas

How To Use Powerpoint In Windows Powerpoint (Windows Powerpoint)

You Should Be Using PowerShell Aaron Kaiser Senior Technology Support Specialist Parkway School District

mspsug-meeting txt

Acknowledgments Finding Your Way Around Windows PowerShell p. 1 Getting Started with Windows PowerShell p. 3 Installing Windows PowerShell p.


DOAG 2011 DP Tricks-1

Lab Answer Key for Module 1: Installing and Configuring Windows Server Table of Contents Lab 1: Configuring Windows Server

The Windows PowerShell Owner s Manual: Version 2.0. Jean Ross and Greg Stemp Microsoft Communications Server UA

POWERSHELL (& SHAREPOINT) This ain t your momma s command line!

Lab Sample Solutions. Chapter 3

POWERSHELL FOR NEWBIES Getting started with PowerShell 4.0. Jeffery Hicks

WHITE PAPER BT Sync, the alternative for DirSync during Migrations

Enable Federated Agents in Chime for Lync

Active Directory Friday: All Articles. Jaap Brasser

ICT dag 03/12 Managing Systems with PowerShell. Bart Portier docent TW KHK Geel Microsoft Certified Trainer

Effective Windows PowerShell. Grok Windows PowerShell and Get More From It.

A layman s guide to PowerShell 2.0 remoting. Ravikanth Chaganti

Windows PowerShell Networking Guide

Note: The scripts in this article should work for XenApp 6 and XenApp 5 for Windows Server 2008 and XenApp 5 for Windows Server 2003.

Active Directory Deployment and Management Enhancements

Windows PowerShell. 3.0 Step by Step. Ed Wilson

Windows Server 2008 R2: Server Management and PowerShell V2

ActiveRoles Management Shell for Active Directory

SharePoint 2016 [PREVIEW] Site Template ID List

Windows PowerShell 2.0

PowerShell Tutorial. Eigil Obrestad and Erik Hjelmås. August 18, 2015

WELCOME TO TECH IMMERSION

Windows Server 2008 R2: What's New in Active Directory

Forefront Management Shell PowerShell Management of Forefront Server Products

5/13/2009. Dejan Foro Speaker

Things I wish I d known when I started using PowerShell

ShoreTel Active Directory Import Application

Powershell Management for Defender

Tools & Techniques for Remote Help Desk Support

Virtualization Hyper-V host scale and scale-up workload support

DocAve 6 SDK and Management Shell

REST API Getting Started Guide

Windows PowerShell Fundamentals

ActiveRoles Management Shell for Active Directory

Question: Hi Everyone! Thank you TEACHERS, MICROSOFT, MVA and Event Support Team for this lesson! Answer: Great to see you POPA DAN!

Server Manageability and Automation

Step-by-Step Guide to Active Directory Bulk Import and Export

ADFS for. LogMeIn and join.me authentication

Troubleshoot Using Event Log Mining

A Test Your PowerShell Prowess

HELP DOCUMENTATION UMRA REFERENCE GUIDE

>

Risk Management GUIDE GUIDE. for PHYSICIAN. Austin, TX

Migrating application users and passwords with Password Manager

AxCMS.net on Network Load Balancing (NLB) Environment

PowerShell 3.0 Advanced Administration Handbook

Windows Server 2012 Scale-Out File Server for SQL Server Step-by-step Installation

Deploying and Managing Active Directory with Windows PowerShell

A CIP catalogue record for this book is available from the British Library.

Installing Sun's VirtualBox on Windows XP and setting up an Ubuntu VM

Using Windows PowerShell with AD RMS... 7 About this guide... 7 In this guide... 7

Avaya Aura System Manager 6.2 LDAP Directory Synchronization Whitepaper

LDAP Directory Integration with Cisco Unity Connection

Active Directory Commands ( )

Dotnet Agent Installation with Remote Management - Powershell Extension Advanced Options

Océ LDAP Adapter User Guide

Technical documentation: SPECOPS PASSWORD POLICY

Windows Command-line Automation Techniques for Dell EqualLogic PS Series Arrays

Automatic Deployment and Authentication Guide

HOW TO: Customise the style of the display name in Active Directory Users and Computers and the GAL

Using Windows PowerShell to Manage SharePoint 2010

A PowerShell Module for Hyper-V

Cloudwork Dashboard User Manual

AD SYNCHRONIZATION GUIDE

INUVIKA OVD SUPPORT SUPPORT SYSTEM GUIDE. Mathieu Schires Version 1.1 Published 28/04/2015

Command-Line Tool for View Manager View Manager 4.0

Active Directory LDAP Quota and Admin account authentication and management

Configure Directory Integration

Windows Server 2012 R2 Storage Infrastructure

STEP 4 : GETTING LIGHTTPD TO WORK ON YOUR SEAGATE GOFLEX SATELLITE

Clouds. Windows Server 2012 Release Candidate. Server Management

Integrate with Directory Sources

metaengine DataConnect For SharePoint 2007 Configuration Guide

HarePoint Analytics. For SharePoint. Administrator Guide

ShoreTel Active Directory Import Application

Extending Remote Desktop for Large Installations. Distributed Package Installs

Quick Start : i-fax User Guide

Configuration Guide. BES12 Cloud

Using the vcenter Orchestrator Plug-In for Microsoft Active Directory

Quick Introduction System Requirements Main features Getting Started Connecting to Active Directory... 4

Using VBScript to Automate User and Group Administration

Technical Overview. Active Directory Synchronization

Here, we will discuss step-by-step procedure for enabling LDAP Authentication.

Automating Tasks Using PowerShell Scripting

Steps to setup authentication and enrolment through LDAP protocol

Automating. Administration. Microsoft SharePoint with Windows. PowerShell 2.0. Gary Lapointe Shannon Bray. Wiley Publishing, Inc.

Transcription:

# Demo: jak to działa? #region Obiekt w rurce ps & { $_.GetType(.FullName #region Begin -> Process -> End $Przed = $false $Po = $false 1,2,3 & { Begin { Write-Warning "Begin 1" Write-Warning "Tu nic nie ma: $_" $Global:Przed = $true Process { Write-Warning "Process 1" Write-Warning "jest: $_" $_ End { Write-Warning "End 1" Write-Warning "ostatni element: $_" $Global:Po = $true & { Begin { Write-Warning "Begin 2" Process { Write-Warning "Process 2" End { Write-Warning "End 2" #region Kim jesteś, co masz? notepad; notepad; notepad Get-Process -Name notepad Stop-Process -WhatIf @' Name notepad '@ ConvertFrom-Csv Tee-Object -Variable Lista $Lista Stop-Process -WhatIf $Lista Stop-Process Get-Service Stop-Process -WhatIf -ErrorAction SilentlyContinue Get-Process Get-Item -EA 0 select -First 10 Format-Table -AutoSize Name, FullName, Length Get-Help -Name Get-Process -Parameter InputObject Get-Help -Name Get-Process -Parameter Name Get-Help -Name Get-Item -Parameter Path Get-Process -Id $PID select Path

# Demo: Where i Foreach + bonusy... #region Where $true 'csrss','lsass' -contains $_.Name $_.Name -notmatch '.s.ss' Get-Process Where-Object { $_ Get-Item -EA 0 Where-Object { $_.Length -gt 1MB Write-Warning "Name $($_.Name: Size $($_.Length" #region foreach $ListaStringow = @' Pracownik "Nowak, Anna" "Powers, Austin" "Fasola, Jaś" "Groźny, Iwan" '@ ConvertFrom-Csv $ListaStringow ForEach-Object { $Nazwisko, $Imie = $_.Pracownik.Split(',' $Imie = $Imie.Trim( # Get-ADUser -LdapFilter "(&(givenname=$imie(sn=$nazwisko" Imie = $Imie Nazwisko = $Nazwisko #region opcjonalnie - inne *-Object # Co mamy...? Get-Command -Noun Object # sortujemy... ls *.txt Sort-Object -Property LastWriteTime ls *.txt Sort-Object -Property { [int]($_.basename -replace '.*?(\d+.*', '$1' # grupujemy ls Group-Object -Property Extension Get-Service Group-Object { $_.Name.Substring(0,3 Where-Object Count -gt 3

#region nowości Get-ChildItem Where-Object { $_.Name -Match 'ps1$' Show-Command Where-Object gps? Path -m System32 Get-ChildItem ForEach-Object -MemberName Name Show-Command ForEach-Object gps? Path -m System32 % Path calc; calc; calc gps calc % Id gps calc? Id -gt 7.KB % Kill gps calc kill gwmi win32_share -list gm -MemberType Method % Definition gwmi win32_share -list % Create $PSHOME Posh 0 gwmi win32_share? Name -m ^P gwmi win32_share? Name -m ^P % Delete

# Demo: trick-shots #region Po nazwie Get-ChildItem -Filter *.txt ForEach-Object { $NowaNazwa = $_.Name -replace '_(\d+', '-$1' Rename-Item -Path $_.FullName -NewName $NowaNazwa -WhatIf Get-Help -Name Rename-Item -Parameter NewName Get-Help -Name Rename-Item -Parameter LiteralPath Trace-Command -Name ParameterBinding -Expression { Get-ChildItem -Filter *.txt Rename-Item -NewName { $_.Name -replace '_(\d+', '-$1' -WhatIf -PSHost Get-ChildItem -Filter *.txt Get-Member LiteralPath (Get-Command Rename-Item.Parameters.LiteralPath.Aliases Get-ChildItem -Filter *.txt Get-Member PSPath Get-Help New-ADUser -Parameter * where pipelineinput -m ByPropertyName ft -a name, pipelineinput ipmo ActiveDirectory New-PSDrive -Name Monad -PSProvider ActiveDirectory -Root '' -Server 192.168.100.1 - Credential $MonadCredentials cd 'Monad:\OU=Users,OU=IT,OU=War,DC=monad,DC=ps1' @' Login,Nazwisko,Imie JasFasola,Fasola,Jas '@ ConvertFrom-Csv New-ADUser -SamAccountName { $_.Login -GivenName { $_.Imie -Surname { $_.Nazwisko -DisplayName { "{0, {1" -f $_.Nazwisko, $_.Imie -EmailAddress { "{0.{1@wguisw.org" -f $_.Imie, $_.Nazwisko -Name { "{0.{1" -f $_.Imie, $_.Nazwisko -UserPrincipalName { "{0{1@wguisw.org" -f $_.Imie, $_.Nazwisko ls -Properties * #region Nasze rurkowate function Read-PipelineZle { ValueFromPipeline = $true ]$Test $Test 1,2,3 Read-PipelineZle

function Read-PipelineDobrze { ValueFromPipeline = $true ]$Test $Test 1,2,3 Read-PipelineDobrze function Read-PipelineWiele { ValueFromPipelineByPropertyName = $true ] [Alias('Jas','Malgosia'] [string]$pierwszy, ValueFromPipelineByPropertyName = $true ] [Alias('Czarownica'] [string]$drugi "$Pierwszy piecze $Drugi" Pierwszy = 'Jas' Drugi = 'Czarownica' Read-PipelineWiele Jas = 'Jas' Czarownica = 'Czarownica' Read-PipelineWiele Pierwszy = 'Czarownica' Jas = 'Jas' Read-PipelineWiele -Drugi { $_.Jas #region podmianka $Komenda = [System.Management.Automation.ProxyCommand]::Create( (Get-Command Get-EventLog $Plik = $psise.currentpowershelltab.files.add( $Plik.Editor.Text = @" function Get-EventLog { $Komenda "@