Creating Exchange 2016 Users with Mailboxes from CSV – fast&easy

First, we need to prepare CSV. What I normally do is to open Excel, prepare the data and than save it as CSV in my case in C:\Temp\import.csv

Once we have CSV prepared, we can open Exchange Managment Shell and run following commands:

$Password = convertto-securestring $_.password -asplaintext -force

Import-CSV C:\temp\import.csv | ForEach {New-Mailbox -Name $ -firstname $_.firstname -lastname $_.lastname -userPrincipalName $_.userprincipalname -Password $Password -database $_.MBDB}





SQL database backup with Powershell


This backup script will do backup for all databases within my instance SQLINSTANCE\SQLINSTANCE and store it to BACKUP folder configured during the SQL installation.

Import-Module “sqlps” -DisableNameChecking            
foreach ($db in (Get-ChildItem))            
         $dbname = $db.Name            
         $dt = Get-Date -Format yyyyMMddHHmmss            
         Backup-SqlDatabase -Database $dbname -BackupFile "$($dbname)_db_$($dt).bak"