Tout commence par en connaitre l'existence, comment faire peut s'apprendre.
Un petit memento des commandes Powershell de base qui dépanne toujours.
Connect on remote conputer with powershell :
Enter-PSSession $HOSTNAME
Equivalent du grep Linux avec Powershell
AnyList | where {$_ -match ‘$FIND’}
AnyList | where {$_ -like ‘%FIND%’}
Process list and order by %CPU
ps | sort CPU -desc
Find a process by app name
ps | where {$_ -match “$APPNAME”}
Kill process, $PROCESSID is a ID obtain with ps command.
Kill $PROCESSID
Kill process by app name
kill (ps | where {$_ -match “$APPNAME “}).Id
Get uptime of system
(get-wmiobject -class “win32_operatingsystem” -namespace “root\CIMV2”).lastbootuptime
Get-WmiObject win32_operatingsystem | select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}
List of hotfix installed
Get-HotFix
Get-HotFix | sort InstalledOn
Any memory informations
get-wmiobject -class “win32_physicalmemory” -namespace “root\CIMV2”
Memory quantity in Go:
To change unity change the value of Pow function.
((get-wmiobject -class “win32_physicalmemory” -namespace “root\CIMV2”).Capacity)/([math]::Pow(1024,3))
Any CPU informations
get-wmiobject -class “win32_processor”
CPU informations socket and core
get-wmiobject -class “win32_processor” | select NumberOfCores, NumberOfLogicalProcessors | FT
List of drivers
pnputil -e
Add and install driver
pnputil –i –a $pathOfINFFiles
Space disk usage
get-WmiObject win32_logicaldisk | ForEach-Object {write-host $_.DeviceId ” : ” ($_.FreeSpace / 1GB) “Go \ ” ($_.Size / 1GB) “Go ==> % Free :” ($_.FreeSpace*100/$_.Size)}
Page file infos
Get-WmiObject Win32_PageFileusage | Select-Object Name,AllocatedBaseSize,PeakUsage
Find event in event log security
Get-EventLog -logname security | where eventid – eq 4624 | select -first 50
Connection to the tenant
mport-Module MSOnline
$c = Get-Credential
#Dans le fenetre saisir username + MDP : benoit@mondomain.onmicrosoft.com
Connect-MsolService -Credential $c
Cookie | Durée | Description |
---|---|---|
cookielawinfo-checbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-advertisement | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Advertisement". | |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Cookie | Durée | Description |
---|---|---|
tk_lr | 1 year | This cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack |
tk_or | 5 years | This cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack |
tk_r3d | 3 days | The cookie is installed by JetPack. Used for the internal metrics fo user activities to improve user experience |
Cookie | Durée | Description |
---|---|---|
pvc_visits[0] | 1 day | This cookie is created by post-views-counter. This cookie is used to count the number of visits to a post. It also helps in preventing repeat views of a post by a visitor. |