update
This commit is contained in:
1133
Exchange/ExchangeEnvironmentReport.ps1
Normal file
1133
Exchange/ExchangeEnvironmentReport.ps1
Normal file
File diff suppressed because it is too large
Load Diff
1143
Exchange/Get-ExchangeEnvironmentReport.ps1
Normal file
1143
Exchange/Get-ExchangeEnvironmentReport.ps1
Normal file
File diff suppressed because it is too large
Load Diff
50
Exchange/Rapports-MailBox.ps1
Normal file
50
Exchange/Rapports-MailBox.ps1
Normal file
@ -0,0 +1,50 @@
|
||||
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
|
||||
|
||||
$Date = Get-Date -format 'yyyy-MM-dd HH-mm-ss'
|
||||
$Fichier = "D:\Informatique\All-Mailbox-$Date.csv"
|
||||
$emailAttachments = "D:\Informatique\All-Mailbox.csv"
|
||||
|
||||
#Get-Mailbox -ResultSize Unlimited | Select-Object Displayname,name,alias,PrimarySmtpAddress,Database,@{Name='TotalItemSize'; Expression={[String]::join(";",((Get-MailboxStatistics -identity $_.identity).TotalItemSize))}},@{Name='ItemCount'; Expression={[String]::join(";",((Get-MailboxStatistics -identity $_.identity).ItemCount))}},IssueWarningQuota, ProhibitSendQuota, ProhibitSendReceiveQuota | where-object {$_.enabled -eq $True} | export-csv -path $Fichier
|
||||
Get-Mailbox -ResultSize Unlimited | Select-Object Displayname,name,alias,PrimarySmtpAddress,Database,@{Name='TotalItemSize'; Expression={[String]::join(";",((Get-MailboxStatistics -identity $_.identity).TotalItemSize))}},@{Name='ItemCount'; Expression={[String]::join(";",((Get-MailboxStatistics -identity $_.identity).ItemCount))}},IssueWarningQuota, ProhibitSendQuota, ProhibitSendReceiveQuota | export-csv -path $Fichier
|
||||
|
||||
$SPLA = (Get-Mailbox -ResultSize Unlimited -Filter {EmailAddresses -like "*.mailnot.fr"} ).Count
|
||||
|
||||
(Get-Content $Fichier) -replace '","','";"' | Set-Content "D:\Informatique\All-Mailbox-temp.csv"
|
||||
(Get-Content "D:\Informatique\All-Mailbox-temp.csv") -replace ',,,',';;;' | Set-Content $emailAttachments
|
||||
|
||||
Start-Sleep -s 10
|
||||
|
||||
$emailSmtpServer = "10.101.10.2"
|
||||
$emailSmtpServerPort = "25"
|
||||
|
||||
$emailFrom = "Rapports@cloud-fichorga.fr"
|
||||
$emailTo = "hcornet@fichorga.fr, ypereira@fichorga.fr, fdupont@fichorga.fr, cleroux@fichorga.fr, jmdefossez@fichorga.fr, alefevre@pmsjuris.fr, sdemarez@fichorga.fr, mdelplanche@fichorga.fr, eringuet@fichorga.fr"
|
||||
|
||||
|
||||
$body = "<HTML><HEAD><META http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"" /><TITLE></TITLE></HEAD>"
|
||||
$body += "<BODY bgcolor=""#FFFFFF"" style=""font-size: Small; font-family: TAHOMA; color: #000000""><P>"
|
||||
$body += "Bonjour <b><font color=blue>a tous</b></font><br><br>"
|
||||
$body += "Voici l'extraction de l'ensemble des boites mail client a la date du <b>$Date</b>.<br>"
|
||||
$body += "<br><br>"
|
||||
$body += "Il y a : <b><font color=blue>$SPLA</b></font> comptes à déclarer pour le SPLA.<br>"
|
||||
$body += "<br><br>"
|
||||
$body += "Bonne lecture.<br><br>"
|
||||
$body += "<b><font color=red>Merci de ne pas faire repondre a ce message.</b></font><br>"
|
||||
$body += "Pour ne plus faire partie de la liste <a href='mailto:hcornet@fichorga.fr?Subject=Desinscription%20Rapport%20mail' target='_top'>Send Mail</a>.<br>"
|
||||
|
||||
$emailMessage = New-Object System.Net.Mail.MailMessage( $emailFrom , $emailTo )
|
||||
$emailMessage.Subject = "Extraction : client CONNECT"
|
||||
$emailMessage.IsBodyHtml = $True
|
||||
$emailMessage.Body = $body
|
||||
$emailMessage.Attachments.add($emailAttachments)
|
||||
|
||||
$SMTPClient = New-Object System.Net.Mail.SmtpClient( $emailSmtpServer, $emailSmtpServerPort )
|
||||
$SMTPClient.EnableSsl = $False
|
||||
$SMTPClient.Send( $emailMessage )
|
||||
|
||||
Start-Sleep -s 10
|
||||
|
||||
Remove-Item "D:\Informatique\All-Mailbox-$Date.csv" -recurse
|
||||
Remove-Item "D:\Informatique\All-Mailbox-temp.csv" -recurse
|
||||
Remove-Item "D:\Informatique\All-Mailbox.csv" -recurse
|
||||
|
2157
Exchange/Test-ExchangeServerHealth.ps1
Normal file
2157
Exchange/Test-ExchangeServerHealth.ps1
Normal file
File diff suppressed because it is too large
Load Diff
1
Exchange/purge.ps1
Normal file
1
Exchange/purge.ps1
Normal file
@ -0,0 +1 @@
|
||||
Get-ChildItem 'C:\Inetpub\Logs' -Directory | Get-ChildItem -Include '*.log' -Recurse | ? LastWriteTime -lt (Get-Date).AddDays(-20) | Remove-Item
|
4
Exchange/scheduler.ps1
Normal file
4
Exchange/scheduler.ps1
Normal file
@ -0,0 +1,4 @@
|
||||
.\ExchangeEnvironmentReport.ps1 -HTMLReport .\report.html -SendMail $True -MailFrom "Rapports@cloud-fichorga.fr" -MailTo "hcornet@fichorga.fr" -MailServer 10.101.10.2
|
||||
.\ExchangeEnvironmentReport.ps1 -HTMLReport .\report.html -SendMail $True -MailFrom "Rapports@cloud-fichorga.fr" -MailTo "jmdefossez@fichorga.fr" -MailServer 10.101.10.2
|
||||
.\ExchangeEnvironmentReport.ps1 -HTMLReport .\report.html -SendMail $True -MailFrom "Rapports@cloud-fichorga.fr" -MailTo "alefevre@pmsjuris.fr" -MailServer 10.101.10.2
|
||||
.\Test-ExchangeServerHealth.ps1 -ReportMode -SendEmail
|
Reference in New Issue
Block a user