Adding Users to O365 Distribution List

By admin

A script I recently used to add members to an office 365 distribution group using a remote exchange session in a hybrid setup (covered at the end).  [cc lang=”powershell”]$SourceFile = “” Import-CSV $SourceFile | ForEach ` {Add-DistributionGroupMember -Identity “Group Name” -Member $_.UPN Write-Host -ForegroundColor Green “Processed the record for $($_.UPN)” }[/cc] CSV file contains UPNs…

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]