PowerShell Training Resources

PowerShell Training Resources

Here are some sites and references if you want to learn or train in Powershell

Microsoft Virtual Academy

Microsoft Virtual Academy (MVA) is a logical first-stop when searching for sources of free learning. A search for “powershell” on the main page of the MVA website returns 68 hits, 13 of which include PowerShell in the course title.

Powershell Cheat Sheet

Powershell Cheat Sheet

roualin powershell-cheat-sheet Powershell Cheat Sheet

 

powershell-cheat-sheet

O365 – Tips & Tricks in Powershell

O365 – Tips & Tricks in Powershell

Hello,

For those who are starting to work on O365 using powershell, here below are some short lines to help you.

Prerequisites :

https://technet.microsoft.com/en-us/library/dn975125.aspx

Connect to O365 :

$cred=get-credential -Message "Please provide an O365 admin account"
connect-msolservice -credential $cred
$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session -AllowClobber

Add a licence to a user :

O365 – Check Sync batch

O365 – Check Sync batch


When you are doing a migration from Exchange to O365, there are two ways :

  • Direct Migration
  • Two step migration (provisioning then migrating)

If you choose the second way, you’ll have to check if all mailboxes are synced and not failed.

Open a file with its default application

Open a file with its default application

Hey there !

A little tip I’ve just found, really usefull.

If you need to open a file through Powershell with the default application set up in Windows parameter, just use “Start-process” and the full path of your file

Start-Process "c:\temp\MyExcelFile.xlsx"

In this short example, this command will launch Excel and your file !

Group-Object is magic !

Group-Object is magic !

I had to create a script that sort a whole csv, each line is an extract of a computer scan, one extract per day, and get only the last extract per computer AND per user.

Indeed, a user can use multiple computers, and several users can use the same computer, the extract result is not the same !

Sort files by extension with total size

Sort files by extension with total size

For several reasons, it could be awesome to sort a folder and sub by extension, with the associated size for each.

 

$results=Get-ChildItem -Path "y:\" -Recurse |
#Get only files
Where-Object { !$_.PSIsContainer } |
#Group by extension
Group-Object Extension |
#Get data
Select-Object @{n="Extension";e={$_.Name -replace '^\.'}}, @{n="Size (MB)";e={[math]::Round((($_.Group | Measure-Object Length -Sum).Sum / 1MB), 2)}}, Count
$results |Sort-Object "Size (MB)"|Export-csv "$WorkingDir\Results\$ResultFile" -NoTypeInformation

 

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site