SlideShare ist ein Scribd-Unternehmen logo
1 von 16
• Introduced in 2006
• Implemented as an engine that can be embedded
in a GUI or used directly as a CLI
• Works with modules.
• PowerShell is not just a shell; it is a complete
scripting environment.
• PowerShell Core is the new generation of
PowerShell, it is open source and cross-platform
meaning it could now run on Linux, MacOS, and
Windows!
The ISE enables you to run commands and design, write, test,
and debug scripts in a Windows GUI
Windows
PowerShell
tabs
Script pane
Console pane Add-in
Tools pane
IntelliSense
suggestions
• Verb is the action the cmdlet performs:
• Get
• Set
• New
• Add
• Remove
• Noun is the resource the cmdlet affects:
• Service
• Process
• Prefixes are used to group related nouns:
• AD (Active Directory), SP (SharePoint), AzureAD
• Update-Help utilizes downloadable help content
to update your local Help
• No Help content is distributed with PowerShell
• Get-Help provides quick access to syntax help for
PowerShell commands
• Use –ShowWindow to display help in a floating
window
• Use –Example to quickly jump to usage examples
• Use –Online to display web-based version of help
in your system’s default web browser
• A PSProvider is basically a Windows PowerShell
adapter that makes some form of storage
resemble a disk drive.
• A PSDrive is an actual connection to a form of
storage.
• Run Get-PSDrive for a list
• Run New-PSDrive to map a new drive
• Windows PowerShell runs commands in a pipeline
• In the console, each complete command line is a
pipeline
• Pipelines can contain one or more commands,
with multiple commands separated by a vertical
pipe character (|)
• Commands execute from left to right, with the
output of each command being piped (passed) to
the command after it
• The output of the last command in the pipeline is
what appears on your screen
Get-ADUser –Filter * | Enable-ADAccount Enable
ADAccount
Cmdlet
Get-ADUser
Cmdlet
• The pipeline connects the output from one cmdlet to the
input of another cmdlet
• The combination of the first cmdlet, pipe, and second cmdlet
makes a pipeline
Process
Object
Pipe
Get-Service | Out-File ServiceList.txt
Get-Process | Get-Member
Get-ChildItem –Path C:Windows | Get-Member
Get-Service | Sort Status,Name
Get-Process | Measure-Object
Get-Service | Sort-Object -Property Status | Select-Object –First 10
Get-Service | Select-Object –Property Name,Status
Get-Service | Export-CSV C:TempServices.csv
Get-Service | Where Status –eq Running
Get-Service | Where {$PSItem.Status –eq 'Running' }
Get-Volume | Where {$PSItem.HealthStatus –ne 'Healthy‘ -or
$PSItem.SizeRemaining –lt 100MB }
FOREACH example
Get-ChildItem -Path C:TEMP -file | ForEach-Object LastAccessTime
SET CONTENT example
"One", "Two", "Three", "Four" | Set-Content -Path C:Temptmp.txt
MEASURE OBJECT example
Get-Content C:Temptmp.txt | Measure-Object -Character -Line –Word
List Network connections and categories
Get-NetConnectionProfile
Set network connection to “Private”
Set-NetConnectionProfile -InterfaceIndex <index number> -NetworkCategory
Private
List all services with dependencies on local computer
Get-Service | Where-Object {$_.dependentServices} | Format-List -Property
Name, DependentServices, @{Label="NotDependentServices";
Expression={$_.DependentServices.count}}
List last 20 Events in EventLog
Get-EventLog -Newest 20 -logname "<log name>"
List all Errors in a specified Log
Get-EventLog -LogName <logname> -EntryType Error
Get EventLog from multiple computers
Get-EventLog -LogName "Windows PowerShell" -ComputerName "localhost",
"Server01", "Server02"
List all Events containing a specified word in event description
Get-EventLog -LogName "Application" -Message "*failed*"
Set-ExecutionPolicy Unrestricted
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName
Microsoft.Exchange -ConnectionUri
https://outlook.office365.com/powershell-liveid/ -
Credential $UserCredential -Authentication Basic -
AllowRedirection
Import-PSSession $Session
#Solo analisi
Get-Mailbox -ResultSize 4000 | select
UserPrincipalName,ForwardingSmtpAddress,DeliverToMailboxAnd
Forward
#Creazione CSV
Get-Mailbox -ResultSize 4000 | select
UserPrincipalName,ForwardingSmtpAddress,DeliverToMailboxAnd
Forward | Export-csv c:tempOffice365Forwards.csv –
NoTypeInformation
<#
-> Dettagli OU Disabilitate
-> OU Vuote
-> OU Totale
-> Utenti con Nessuna Scadenza Password
-> Links GPO
-> Dettagli GPO
-> Account Inattivi
-> Gruppi con Privilegi Elevati
-> SchemaHistory
-> Stato w32tm2
-> Configurazione w32tm1
-> DC daig
-> Oggetti Computer
#>
# Caricamento Modulo Powershell per Active Directory
try{
Import-Module ActiveDirectory
$Inactivedays = "60" #Inserire il numero di giorni
desiderato
#date
$date = $((Get-Date).ToString('MM-dd-yyyy_hh-mm'))
#path
$path = ".AD_Reports_$date"
if (!(Test-path $path))
{
md $path | Out-Null
}}
catch{
Write-Host “Problema Rilevato durante la creazione della
cartella: $_.Exception.Message "}
Write-Host -ForegroundColor Green "!! Sto recuperando i dati
da Active Directory... !!"
try{
Write-Host "-------------------------------------------------"
Write-Host "Gathering inactive users details..."
Write-Host "-------------------------------------------------"
#Get inactive accounts details
$selection = "EmployeeID", "Name",
"SamAccountName","ObjectSid","ObjectGUID","Enabled",
"UserPrincipalName", "whenChanged", "whenCreated",
"PasswordNeverExpires", "PasswordLastSet", "LastLogonDate",
"lastLogonTimestamp", "DistinguishedName", "Description"
$resultInactive = Search-ADAccount -usersonly -accountinactive
-timespan $Inactivedays
$Inactiveuser = $resultInactive | Get-ADUser -Properties * |
select $selection
$INACount = $Inactiveuser.Count

Weitere ähnliche Inhalte

Was ist angesagt?

Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolutionWise Engineering
 
Powerhsell dsc for chef veterans
Powerhsell dsc for chef veteransPowerhsell dsc for chef veterans
Powerhsell dsc for chef veteransDamien Caro
 
Opscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsOpscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsChef Software, Inc.
 
Tips and Tricks for Automating Windows with Chef
Tips and Tricks for Automating Windows with ChefTips and Tricks for Automating Windows with Chef
Tips and Tricks for Automating Windows with ChefChef Software, Inc.
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.xYiguang Hu
 
PowerShell and SharePoint
PowerShell and SharePointPowerShell and SharePoint
PowerShell and SharePointTalbott Crowell
 
Consume wsa
Consume wsaConsume wsa
Consume wsamahe797
 
Cooking with Chef on Windows
Cooking with Chef on WindowsCooking with Chef on Windows
Cooking with Chef on WindowsJulian Dunn
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OSJulian Dunn
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeSarah Z
 
Chef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationChef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationJulian Dunn
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & Youjskulski
 
Postman tests in jenkins
Postman tests in jenkinsPostman tests in jenkins
Postman tests in jenkinsAlex Galkin
 
Cooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionCooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionJulian Dunn
 
Serverless forwardjs
Serverless forwardjsServerless forwardjs
Serverless forwardjsUpkar Lidder
 

Was ist angesagt? (20)

Consul presentation
Consul presentationConsul presentation
Consul presentation
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
Powerhsell dsc for chef veterans
Powerhsell dsc for chef veteransPowerhsell dsc for chef veterans
Powerhsell dsc for chef veterans
 
Opscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsOpscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft Windows
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Tips and Tricks for Automating Windows with Chef
Tips and Tricks for Automating Windows with ChefTips and Tricks for Automating Windows with Chef
Tips and Tricks for Automating Windows with Chef
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
Pantheon basics
Pantheon basicsPantheon basics
Pantheon basics
 
PowerShell and SharePoint
PowerShell and SharePointPowerShell and SharePoint
PowerShell and SharePoint
 
Consume wsa
Consume wsaConsume wsa
Consume wsa
 
Cooking with Chef on Windows
Cooking with Chef on WindowsCooking with Chef on Windows
Cooking with Chef on Windows
 
FV04_MostoviczT_RAD
FV04_MostoviczT_RADFV04_MostoviczT_RAD
FV04_MostoviczT_RAD
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OS
 
EC2 Container Service
EC2 Container ServiceEC2 Container Service
EC2 Container Service
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
Chef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationChef and PowerShell Desired State Configuration
Chef and PowerShell Desired State Configuration
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
 
Postman tests in jenkins
Postman tests in jenkinsPostman tests in jenkins
Postman tests in jenkins
 
Cooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionCooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 Edition
 
Serverless forwardjs
Serverless forwardjsServerless forwardjs
Serverless forwardjs
 

Ähnlich wie CCI2019 - I've got the Power! I've got the Shell!

Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementSharkrit JOBBO
 
Power shell training
Power shell trainingPower shell training
Power shell trainingDavid Brabant
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubEssam Salah
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009John Clayton
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
PowerShell Technical Overview
PowerShell Technical OverviewPowerShell Technical Overview
PowerShell Technical Overviewallandcp
 
Microsoft Offical Course 20410C_04
Microsoft Offical Course 20410C_04Microsoft Offical Course 20410C_04
Microsoft Offical Course 20410C_04gameaxt
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfClapperboardCinemaPV
 
PowerShell for SharePoint Admins
PowerShell for SharePoint AdminsPowerShell for SharePoint Admins
PowerShell for SharePoint AdminsRick Taylor
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2Vincent Mercier
 
Delivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDelivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDmitry Buzdin
 
DevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows Machines
DevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows MachinesDevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows Machines
DevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows MachinesDevOpsDays Riga
 
PowerShell Fundamentals
PowerShell FundamentalsPowerShell Fundamentals
PowerShell Fundamentalsmozdzen
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopersBryan Cafferky
 
Troubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDKTroubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDKDavid McGeough
 
PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2Bryan Cafferky
 

Ähnlich wie CCI2019 - I've got the Power! I've got the Shell! (20)

PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server Management
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
PowerShell Technical Overview
PowerShell Technical OverviewPowerShell Technical Overview
PowerShell Technical Overview
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 
Microsoft Offical Course 20410C_04
Microsoft Offical Course 20410C_04Microsoft Offical Course 20410C_04
Microsoft Offical Course 20410C_04
 
PowerShell-2
PowerShell-2PowerShell-2
PowerShell-2
 
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfLearn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
 
PowerShell for SharePoint Admins
PowerShell for SharePoint AdminsPowerShell for SharePoint Admins
PowerShell for SharePoint Admins
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2
 
Delivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDelivery Pipeline for Windows Machines
Delivery Pipeline for Windows Machines
 
DevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows Machines
DevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows MachinesDevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows Machines
DevOpsDaysRiga 2017: Dmitry Buzdin - Delivery Pipeline for Windows Machines
 
PowerShell Fundamentals
PowerShell FundamentalsPowerShell Fundamentals
PowerShell Fundamentals
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
Troubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDKTroubleshooting a XenDesktop Environment using the PowerShell SDK
Troubleshooting a XenDesktop Environment using the PowerShell SDK
 
Asp.net tips
Asp.net tipsAsp.net tips
Asp.net tips
 
PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2
 

Mehr von walk2talk srl

CCI 2019 - SQL Injection - Black Hat Vs White Hat
CCI 2019 - SQL Injection - Black Hat Vs White HatCCI 2019 - SQL Injection - Black Hat Vs White Hat
CCI 2019 - SQL Injection - Black Hat Vs White Hatwalk2talk srl
 
CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...
CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...
CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...walk2talk srl
 
CCI 2019 - Come ottimizzare i propri workload su Azure
CCI 2019 - Come ottimizzare i propri workload su AzureCCI 2019 - Come ottimizzare i propri workload su Azure
CCI 2019 - Come ottimizzare i propri workload su Azurewalk2talk srl
 
CCI 2019 - Exchange 2019 da 0 ad HA in 1 ora
CCI 2019 - Exchange 2019 da 0 ad HA in 1 oraCCI 2019 - Exchange 2019 da 0 ad HA in 1 ora
CCI 2019 - Exchange 2019 da 0 ad HA in 1 orawalk2talk srl
 
CCI 2019 - PowerApps for Enterprise Developers
CCI 2019 - PowerApps for Enterprise DevelopersCCI 2019 - PowerApps for Enterprise Developers
CCI 2019 - PowerApps for Enterprise Developerswalk2talk srl
 
CCI 2019 - Architettare componenti in SPFx, esperienze sul campo
CCI 2019 - Architettare componenti in SPFx, esperienze sul campoCCI 2019 - Architettare componenti in SPFx, esperienze sul campo
CCI 2019 - Architettare componenti in SPFx, esperienze sul campowalk2talk srl
 
CCI 2019 - Step by step come attivare un servizio voce in MS Teams
CCI 2019 - Step by step come attivare un servizio voce in MS TeamsCCI 2019 - Step by step come attivare un servizio voce in MS Teams
CCI 2019 - Step by step come attivare un servizio voce in MS Teamswalk2talk srl
 
CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0
CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0
CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0walk2talk srl
 
CCI2019 - Sistema di controllo del traffico con architettura Big Data
CCI2019 - Sistema di controllo del traffico con architettura Big DataCCI2019 - Sistema di controllo del traffico con architettura Big Data
CCI2019 - Sistema di controllo del traffico con architettura Big Datawalk2talk srl
 
CCI2019 - Governance di una Conversational AI
CCI2019 - Governance di una Conversational AICCI2019 - Governance di una Conversational AI
CCI2019 - Governance di una Conversational AIwalk2talk srl
 
CCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tuttiCCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tuttiwalk2talk srl
 
CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...
CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...
CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...walk2talk srl
 
CCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and Azure
CCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and AzureCCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and Azure
CCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and Azurewalk2talk srl
 
CCI2019 - Teams Direct Routing e servizi fonia avanzati
CCI2019 - Teams Direct Routing e servizi fonia avanzatiCCI2019 - Teams Direct Routing e servizi fonia avanzati
CCI2019 - Teams Direct Routing e servizi fonia avanzatiwalk2talk srl
 
CCI2019 - Microservizi: Idee per un'architettura con al centro l'utente
CCI2019 - Microservizi: Idee per un'architettura con al centro l'utenteCCI2019 - Microservizi: Idee per un'architettura con al centro l'utente
CCI2019 - Microservizi: Idee per un'architettura con al centro l'utentewalk2talk srl
 
CCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal Fronte
CCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal FronteCCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal Fronte
CCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal Frontewalk2talk srl
 
CCI2019 - Monitorare SQL Server Senza Andare in Bancarotta
CCI2019 - Monitorare SQL Server Senza Andare in BancarottaCCI2019 - Monitorare SQL Server Senza Andare in Bancarotta
CCI2019 - Monitorare SQL Server Senza Andare in Bancarottawalk2talk srl
 
CCI2019 - Architecting and Implementing Azure Networking
CCI2019 - Architecting and Implementing Azure NetworkingCCI2019 - Architecting and Implementing Azure Networking
CCI2019 - Architecting and Implementing Azure Networkingwalk2talk srl
 
CCI2019 - Teams e lo Shadow IT
CCI2019 - Teams e lo Shadow ITCCI2019 - Teams e lo Shadow IT
CCI2019 - Teams e lo Shadow ITwalk2talk srl
 
CCI2018 - La "moderna" Sicurezza informatica & Microsoft
CCI2018 - La "moderna" Sicurezza informatica & MicrosoftCCI2018 - La "moderna" Sicurezza informatica & Microsoft
CCI2018 - La "moderna" Sicurezza informatica & Microsoftwalk2talk srl
 

Mehr von walk2talk srl (20)

CCI 2019 - SQL Injection - Black Hat Vs White Hat
CCI 2019 - SQL Injection - Black Hat Vs White HatCCI 2019 - SQL Injection - Black Hat Vs White Hat
CCI 2019 - SQL Injection - Black Hat Vs White Hat
 
CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...
CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...
CCI 2019 - Exploiting Custom Vision SDK in Python to create an efficient imag...
 
CCI 2019 - Come ottimizzare i propri workload su Azure
CCI 2019 - Come ottimizzare i propri workload su AzureCCI 2019 - Come ottimizzare i propri workload su Azure
CCI 2019 - Come ottimizzare i propri workload su Azure
 
CCI 2019 - Exchange 2019 da 0 ad HA in 1 ora
CCI 2019 - Exchange 2019 da 0 ad HA in 1 oraCCI 2019 - Exchange 2019 da 0 ad HA in 1 ora
CCI 2019 - Exchange 2019 da 0 ad HA in 1 ora
 
CCI 2019 - PowerApps for Enterprise Developers
CCI 2019 - PowerApps for Enterprise DevelopersCCI 2019 - PowerApps for Enterprise Developers
CCI 2019 - PowerApps for Enterprise Developers
 
CCI 2019 - Architettare componenti in SPFx, esperienze sul campo
CCI 2019 - Architettare componenti in SPFx, esperienze sul campoCCI 2019 - Architettare componenti in SPFx, esperienze sul campo
CCI 2019 - Architettare componenti in SPFx, esperienze sul campo
 
CCI 2019 - Step by step come attivare un servizio voce in MS Teams
CCI 2019 - Step by step come attivare un servizio voce in MS TeamsCCI 2019 - Step by step come attivare un servizio voce in MS Teams
CCI 2019 - Step by step come attivare un servizio voce in MS Teams
 
CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0
CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0
CCI 2019 - Strumenti Azure per l'Anomaly Detection in ambito Industria 4.0
 
CCI2019 - Sistema di controllo del traffico con architettura Big Data
CCI2019 - Sistema di controllo del traffico con architettura Big DataCCI2019 - Sistema di controllo del traffico con architettura Big Data
CCI2019 - Sistema di controllo del traffico con architettura Big Data
 
CCI2019 - Governance di una Conversational AI
CCI2019 - Governance di una Conversational AICCI2019 - Governance di una Conversational AI
CCI2019 - Governance di una Conversational AI
 
CCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tuttiCCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
CCI2019 - SQL Server ed Azure: Disaster Recovery per tutti
 
CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...
CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...
CCI2019 - Reagire agli eventi generati dalla propria infrastruttura con Azure...
 
CCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and Azure
CCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and AzureCCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and Azure
CCI2019 - What's new in Remote Desktop Services on Windows Server 2019 and Azure
 
CCI2019 - Teams Direct Routing e servizi fonia avanzati
CCI2019 - Teams Direct Routing e servizi fonia avanzatiCCI2019 - Teams Direct Routing e servizi fonia avanzati
CCI2019 - Teams Direct Routing e servizi fonia avanzati
 
CCI2019 - Microservizi: Idee per un'architettura con al centro l'utente
CCI2019 - Microservizi: Idee per un'architettura con al centro l'utenteCCI2019 - Microservizi: Idee per un'architettura con al centro l'utente
CCI2019 - Microservizi: Idee per un'architettura con al centro l'utente
 
CCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal Fronte
CCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal FronteCCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal Fronte
CCI2019i - Implementare Azure Multi-Factor Authentication Lettere dal Fronte
 
CCI2019 - Monitorare SQL Server Senza Andare in Bancarotta
CCI2019 - Monitorare SQL Server Senza Andare in BancarottaCCI2019 - Monitorare SQL Server Senza Andare in Bancarotta
CCI2019 - Monitorare SQL Server Senza Andare in Bancarotta
 
CCI2019 - Architecting and Implementing Azure Networking
CCI2019 - Architecting and Implementing Azure NetworkingCCI2019 - Architecting and Implementing Azure Networking
CCI2019 - Architecting and Implementing Azure Networking
 
CCI2019 - Teams e lo Shadow IT
CCI2019 - Teams e lo Shadow ITCCI2019 - Teams e lo Shadow IT
CCI2019 - Teams e lo Shadow IT
 
CCI2018 - La "moderna" Sicurezza informatica & Microsoft
CCI2018 - La "moderna" Sicurezza informatica & MicrosoftCCI2018 - La "moderna" Sicurezza informatica & Microsoft
CCI2018 - La "moderna" Sicurezza informatica & Microsoft
 

Kürzlich hochgeladen

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Kürzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

CCI2019 - I've got the Power! I've got the Shell!

  • 1.
  • 2.
  • 3. • Introduced in 2006 • Implemented as an engine that can be embedded in a GUI or used directly as a CLI • Works with modules. • PowerShell is not just a shell; it is a complete scripting environment. • PowerShell Core is the new generation of PowerShell, it is open source and cross-platform meaning it could now run on Linux, MacOS, and Windows!
  • 4. The ISE enables you to run commands and design, write, test, and debug scripts in a Windows GUI Windows PowerShell tabs Script pane Console pane Add-in Tools pane IntelliSense suggestions
  • 5. • Verb is the action the cmdlet performs: • Get • Set • New • Add • Remove • Noun is the resource the cmdlet affects: • Service • Process • Prefixes are used to group related nouns: • AD (Active Directory), SP (SharePoint), AzureAD
  • 6. • Update-Help utilizes downloadable help content to update your local Help • No Help content is distributed with PowerShell • Get-Help provides quick access to syntax help for PowerShell commands • Use –ShowWindow to display help in a floating window • Use –Example to quickly jump to usage examples • Use –Online to display web-based version of help in your system’s default web browser
  • 7. • A PSProvider is basically a Windows PowerShell adapter that makes some form of storage resemble a disk drive. • A PSDrive is an actual connection to a form of storage. • Run Get-PSDrive for a list • Run New-PSDrive to map a new drive
  • 8. • Windows PowerShell runs commands in a pipeline • In the console, each complete command line is a pipeline • Pipelines can contain one or more commands, with multiple commands separated by a vertical pipe character (|) • Commands execute from left to right, with the output of each command being piped (passed) to the command after it • The output of the last command in the pipeline is what appears on your screen
  • 9. Get-ADUser –Filter * | Enable-ADAccount Enable ADAccount Cmdlet Get-ADUser Cmdlet • The pipeline connects the output from one cmdlet to the input of another cmdlet • The combination of the first cmdlet, pipe, and second cmdlet makes a pipeline Process Object Pipe
  • 10. Get-Service | Out-File ServiceList.txt Get-Process | Get-Member Get-ChildItem –Path C:Windows | Get-Member Get-Service | Sort Status,Name Get-Process | Measure-Object Get-Service | Sort-Object -Property Status | Select-Object –First 10 Get-Service | Select-Object –Property Name,Status Get-Service | Export-CSV C:TempServices.csv Get-Service | Where Status –eq Running Get-Service | Where {$PSItem.Status –eq 'Running' } Get-Volume | Where {$PSItem.HealthStatus –ne 'Healthy‘ -or $PSItem.SizeRemaining –lt 100MB }
  • 11. FOREACH example Get-ChildItem -Path C:TEMP -file | ForEach-Object LastAccessTime SET CONTENT example "One", "Two", "Three", "Four" | Set-Content -Path C:Temptmp.txt MEASURE OBJECT example Get-Content C:Temptmp.txt | Measure-Object -Character -Line –Word List Network connections and categories Get-NetConnectionProfile Set network connection to “Private” Set-NetConnectionProfile -InterfaceIndex <index number> -NetworkCategory Private
  • 12. List all services with dependencies on local computer Get-Service | Where-Object {$_.dependentServices} | Format-List -Property Name, DependentServices, @{Label="NotDependentServices"; Expression={$_.DependentServices.count}} List last 20 Events in EventLog Get-EventLog -Newest 20 -logname "<log name>" List all Errors in a specified Log Get-EventLog -LogName <logname> -EntryType Error Get EventLog from multiple computers Get-EventLog -LogName "Windows PowerShell" -ComputerName "localhost", "Server01", "Server02" List all Events containing a specified word in event description Get-EventLog -LogName "Application" -Message "*failed*"
  • 13. Set-ExecutionPolicy Unrestricted $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ - Credential $UserCredential -Authentication Basic - AllowRedirection Import-PSSession $Session #Solo analisi Get-Mailbox -ResultSize 4000 | select UserPrincipalName,ForwardingSmtpAddress,DeliverToMailboxAnd Forward #Creazione CSV Get-Mailbox -ResultSize 4000 | select UserPrincipalName,ForwardingSmtpAddress,DeliverToMailboxAnd Forward | Export-csv c:tempOffice365Forwards.csv – NoTypeInformation
  • 14. <# -> Dettagli OU Disabilitate -> OU Vuote -> OU Totale -> Utenti con Nessuna Scadenza Password -> Links GPO -> Dettagli GPO -> Account Inattivi -> Gruppi con Privilegi Elevati -> SchemaHistory -> Stato w32tm2 -> Configurazione w32tm1 -> DC daig -> Oggetti Computer #>
  • 15. # Caricamento Modulo Powershell per Active Directory try{ Import-Module ActiveDirectory $Inactivedays = "60" #Inserire il numero di giorni desiderato #date $date = $((Get-Date).ToString('MM-dd-yyyy_hh-mm')) #path $path = ".AD_Reports_$date" if (!(Test-path $path)) { md $path | Out-Null }} catch{ Write-Host “Problema Rilevato durante la creazione della cartella: $_.Exception.Message "}
  • 16. Write-Host -ForegroundColor Green "!! Sto recuperando i dati da Active Directory... !!" try{ Write-Host "-------------------------------------------------" Write-Host "Gathering inactive users details..." Write-Host "-------------------------------------------------" #Get inactive accounts details $selection = "EmployeeID", "Name", "SamAccountName","ObjectSid","ObjectGUID","Enabled", "UserPrincipalName", "whenChanged", "whenCreated", "PasswordNeverExpires", "PasswordLastSet", "LastLogonDate", "lastLogonTimestamp", "DistinguishedName", "Description" $resultInactive = Search-ADAccount -usersonly -accountinactive -timespan $Inactivedays $Inactiveuser = $resultInactive | Get-ADUser -Properties * | select $selection $INACount = $Inactiveuser.Count

Hinweis der Redaktion

  1. Show PS Version info $PSVersionTable Rilasciato inizialmente per gestire Exchange 2007 – exchange management shell PowerShell è una vera e propria shell a riga di comando pensata e strutturata per lo scripting e l’amministrazione di sistema basata su .Net Framework.... Note: Microsoft intendeva in origine rilasciare PowerShell insieme con Vista, ma in seguito ha definito delle date di rilascio diverse per PowerShell. La versione 1.0 è stata rilasciata il 14 novembre 2006. La versione 2.0 è presente di serie su Windows 7. La versione 3.0 è di serie su Windows 8 e Windows Server 2012. La versione 4.0 è di serie su Windows 8.1 e Windows Server 2012 R2 La versione 5.0 è di serie su Windows 10 e Windows Server 2016 TP La versione 5.1 Windows Management Framework (WMF) 5.1 and is included in Windows Server 2016 and Windows 10 Anniversary Edition (1607) You can install Windows PowerShell 5.1 on all the operating systems that you can install Windows PowerShell 5.0 on. To do so, you can download and install the Windows Management Framework 5.1 from the Windows Download Center
  2. New-PSDrive –Name WINDIR –Root C:\Windows –PSProvider FileSystem
  3. Descrivere la slide ANIMATA... Note: I dati in una pipeline sono assegnati ad una speciale variabile denominata $PSItem (nelle versioni vecchie $_ ) che esiste unicamente fintantoche la pipeline è in esecuzione. -Filter è un parametro obbligatorio che filtra i risultati (con * visualizza tutto)
  4. Script per verificare forwarders email
  5. PowerShell uses the ! character as an alias for the logical -not operator: PowerShell interprets everything that is empty, $Null, or 0 to the Boolean $False. Bool can only have $True or $False. By casting the value to a Boolean you can see what PowerShell interprets for each value: [bool]0 # False [bool]1 # True [bool]"" # False [bool]"test" # True [bool]$null # False The locical NOT operation turns each Boolean into its opposite: !$True # Is $False !$False # Is $True ![bool]0 # True ![bool]1 # False ![bool]"" # True ![bool]"test" # False ![bool]$null # True