Powershell script for creating an O365 cloud mailbox within a hybrid exchange environment

By admin

I recently wrote this script that creates an O365 mailbox within a hybrid exchange environment, creating all the necessary attributes etc in exchange and AD Log all output to a local logfile, that is unique each time and won’t get overwritten [cc lang=”powershell”]Start-Transcript -Path $env:LOCALAPPDATA”CloudwyseLogs”$(get-date -Format ddMMyy_HHmmss)”.log” -NoClobber[/cc] Clear output from the screen to prevent…

Set O365 Password to never expire for just one user

By admin

Recently I needed to do this for our PRTG alerting account which was failing to send notifications as the O365 password had expired.  I did this from Powershell within Windows 10 as follows: Launch powershell as Administrator then run [cc lang=”powershell”]Install-Module MsOnline[/cc] Then run [cc lang=”powershell”]Connect-MsOlService[/cc] at this point an O365 authentication box pops up…

Add AD security group to local administrators on Hyper-V server running core

By admin

First connect to the remote server with powershell [cc lang=”powershell”]Enter-PSSession -ComputerName contoso\hv01[/cc] Next run the command to add the group: [cc lang=”powershell”]Add-LocalGroupMember -Group “Administrators” -Member “CONTOSO\Hyper-V Admins”[/cc] If you’re paranoid (like me) and want to check this worked you can use: [cc lang=”powershell”]Get-LocalGroupMember “Administrators”[/cc]