$import= import-csv -Path ‘\email-list.csv’ #location of CSV file $import | ForEach-Object { }
Bulk Add/Push Office365 Email Signature using powershell
$import= import-csv -Path ‘<PATH_TO_CSV_FILE>email-list.csv’ #location of CSV file $import | ForEach-Object { $sig = Get-Mailbox -Identity $_.identity.trim() Set-MailboxMessageConfiguration -Identity $sig.Alias -DefaultFontName ‘Arial’ -AutoAddSignature $true -AutoAddSignatureOnReply $true -SignatureHtml “<html><body><table border=’2′ cellspacing=’3′ cellpadding=’3′ style=’font-family:arial;’ width=’100%’> <tbody> <tr> <td rowspan=’2′ valign=’middle’ style=’width:200px;’ align=’center’><a href=’http://rajanmaharjan.com/?utm_source=logo&utm_medium=signature’ target=’_blank’ ><img src=’http://rajanmaharjan.com.np/logo.png’ /></a> <p style=”margin-top:20px”> <span><a href=’https://www.facebook.com/maharjan.rajan” target=”_blank” […]
Push HTML Format Email Signature in Office365 from powershell
$sig = Get-Mailbox -Identity “rajan.maharjan” Set-MailboxMessageConfiguration -Identity $sig.Alias -DefaultFontName ‘Arial’ -AutoAddSignature $true -AutoAddSignatureOnReply $true -SignatureHtml “<html><body><table border=’2′ cellspacing=’3′ cellpadding=’3′ style=’font-family:arial;’ width=’100%’><tbody><tr><td rowspan=’2′ valign=’middle’ style=’width:200px;’ align=’center’><a href=’http://rajanmaharjan.com/?utm_source=logo&utm_medium=signature’ target=’_blank’ ><img src=’http://rajanmaharjan.com.np/logo.png’ /></a><p style=’margin-top:20px’><span><a href=’https://www.facebook.com/maharjan.rajan’ target=’_blank’ rel=’noopener’><img alt=’facebook icon’ style=’border:0; height:25px; width:25px;’ src=’http://rajanmaharjan.com/icons/facebook.png’ width=’15’ border=’0’></a> </span> <span><a href=’https://twitter.com/rajan_maharjan’ target=’_blank’ rel=’noopener’><img alt=’twitter icon’ style=’border:0; height:25px; […]
Basic commands of Powershell related to Distribution List (DL)
Get-DistributionGroupMember -Identity “GROUP_NAME@rajanmaharjan.com” -ResultSize Unlimited | Select Name, PrimarySMTPAddress | Export-CSV “D:\Rajan-1145\Office365\members-of-dl.csv” -NoTypeInformation -Encoding UTF8 Add-DistributionGroupMember -Identity “GROUP_NAME@rajanmaharjan.com” -Member “rajan@rajanmaharjan.com”
Bulk add members to Distribution List (DL)
$UserCredential = Get-CredentialGet-DistributionGroupMember -Identity “GROUP_NAME@rajanmaharjan.com” | ft alias #to get current list members$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-pssession $Session$import= import-csv -Path ‘<PATH_TO_CSV_FILE>member-to-add-in-dl.csv’ #location of CSV file$import | ForEach-Object { Add-DistributionGroupMember -Identity “GROUP_NAME@rajanmaharjan.com” -Member $_.identity Write-host $_.identity ‘added to distribution list’}
Very first #PowerShell Basic
In windows 10, you just need to do run, Type “Powershell” and choose “Windows PowerShell ISE” You must have office365 Login $UserCredential = Get-Credential –it will ask for login credentials $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-pssession $session Thats it!!!, you are now ready […]