none
Configuration Exchange 2013 RRS feed

คำตอบ

  • TP1:

    logs:
    $temp = Get-ReceiveConnector
    foreach ($item in $temp)
    {
        Set-ReceiveConnector $item.Id -ProtocolLoggingLevel Verbose
    }
    C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive

    new connector:
    New-SendConnector -Name "To Internet" -AddressSpaces * -Internet -SmartHosts smtp.univ-smb.fr

    règles: new-transportrule

    logs emails:
    Get-MessageTrackingLog -Recipients julien.dumez@etu.univ-smb.fr | Select-Object -Property Timestamp,Sender,MessageSubject,EventID

    DNS:
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "smtp" -CName -HostNameAlias "server01.tetras.me"
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "imap" -CName -HostNameAlias "server01.tetras.me"
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "pop3" -CName -HostNameAlias "server01.tetras.me"
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "autodiscover" -CName -HostNameAlias "server01.tetras.me"

    activer les services:

    Set-Service -Name "msExchangeIMAP4" -StartupType Automatic
    Set-Service -Name "msExchangeIMAP4BE" -StartupType Automatic
    Start-Service -Name "msExchangeIMAP4"
    Start-Service -Name "msExchangeIMAP4BE"

    Set-Service -Name "msExchangePOP3" -StartupType Automatic
    Set-Service -Name "msExchangePOP3BE" -StartupType Automatic
    Start-Service -Name "msExchangePOP3"
    Start-Service -Name "msExchangePOP3BE"

    TP2:

    créer une base de donnée:

    New-MailboxDatabase -Name "BDD5_001" -Server server01.tetras.me -EdbFilePath E:\EDB\BDD5_001.edb
    Restart-Service MSExchangeIS

    Quotas:

    Get-MailboxDatabase | Where-Object { $_.Name -like "BDD5*" } | Set-MailboxDatabase -IssueWarningQuota 4700MB -ProhibitSendQuota 4800MB -ProhibitSendReceiveQuota 5000MB

    Monter une BDD:

    Get-MailboxDatabase | Mount-Database

    Déplacer les boites dans les bdd:

    $users = Get-User
    $users | Where-Object { $_.Department -eq "Direction" } | New-MoveRequest -TargetDatabase BDD15_001

    TP3:

    Ajout boites utilisateurs à partir de fichier CSV:

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://server1.tetras.me/PowerShell/
    Import-PSSession $Session

    $users = Import-Csv -Path "C:\users.csv" -Delimiter ";"

    foreach($user in $users)
    {  
        $prenom = $user.firstname
        $off = $user.Office
        $tel = $user.phone
        $nom = $user.lastname
        $dep = $user.department
        $log = $user.login
        $ou = "OU=contoso,DC=tetras,DC=me"
        $password = ConvertTo-SecureString -String "Password1" -Force -AsPlainText
        
        #Ajout des données dans la base Active Directory
        New-Mailbox -Name $nom -UserPrincipalName "$log@tetras.me" -OrganizationalUnit Contoso -Password $password -FirstName $prenom -LastName $nom -DisplayName "$prenom $nom"
        Set-ADUser -Identity $log -Office $off -OfficePhone $tel –Company Contoso -Department $dep
    }

    Config DNS:

    Add-DnsServerPrimaryZone -Name contoso.com -ReplicationScope Domain
    Add-DnsServerResourceRecordMX -ZoneName contoso.com -Name contoso.com -MailExchange server1.tetras.me -Preference 10

    Autorisation reception des email du domaine:

    New-AcceptedDomain -Name contoso.com -DomainName contoso.com –DomainType Authoritative

    Création d'un utilisateur:

    New-ADOrganizationalUnit -Name "Contoso"
    $password = ConvertTo-SecureString -String "Password1" -Force -AsPlainText
    New-Mailbox -Name juliend -UserPrincipalName julien@tetras.me -OrganizationalUnit Contoso -Password $password -FirstName Julien –LastName DUMEZ -DisplayName "Julien DUMEZ"
    Set-ADUser -Identity julien -Office C274 -OfficePhone 0606474144 –Company Contoso -Department IT

    Création politique d'adressage:

    New-EmailAddressPolicy -Name "contoso.com" -IncludedRecipients AllRecipients –RecipientContainer "Contoso" –EnabledEmailAddressTemplates "smtp:%g@contoso.com","SMTP:%g.%s@contoso.com"
    Update-EmailAddressPolicy -Identity "contoso.com"

    Adresse de redirection:

    Set-Mailbox -Identity julien -DeliverToMailboxAndForward $false -ForwardingSmtpAddress julien.dumez@etu.univ-smb.fr

    Créer un groupe de distribution:

    New-DistributionGroup -Name "ContosoAndCo" -Alias "contoso_and_co" -OrganizationalUnit Contoso
    Add-DistributionGroupMember -Identity "ContosoAndCo" -Member julien

    Liste de distribution dynamique:

    $communication = (Get-Recipient | Where-Object { $_.Department -eq "Communication" })[0]
    New-DynamicDistributionGroup -Name "Tout le monde" -Alias "tout_le_monde" -IncludedRecipients MailboxUsers -RecipientContainer Contoso -ModerationEnabled $true -ModeratedBy $communication.Alias

    Créer des salles de réunion:

     $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://server1.tetras.me/PowerShell/
    Import-PSSession $Session

    for($roomNumber=1; $roomNumber -le 4; $roomNumber++) {
        New-Mailbox -Room -Name "Salle de reunion $roomNumber" -Alias "salle_de_reunion_$roomNumber" -OrganizationalUnit "Contoso"
    }


    Créer des voitures:

    $moderator = Get-Recipient -Identity julien
    for($carNumber=1; $carNumber -le 4; $carNumber++) {
        New-Mailbox -Equipment -Name "Voiture $carNumber" -Alias "voiture_$carNumber" -OrganizationalUnit "Contoso" -ModerationEnabled $true -ModeratedBy $moderator.Alias
    }

    New-AddressList -Name "Toutes les voitures" -RecipientFilter { (RecipientTypeDetails -eq "EquipmentMailbox") -and (Name -like "Voiture *") }
    Update-AddressList -Identity "Toutes les voitures"

    TP4:

    Fonctionnalité backup windows:

    Install-WindowsFeature -Name "Windows-Server-Backup"

    Sauvegarde planifié:

    $save = New-WBPolicy
    Add-WBFileSpec -Policy $save -FileSpec (New-WBFileSpec –FileSpec "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\")
    Add-WBBackupTarget -Policy $save -Target (New-WBBackupTarget –VolumePath E:)
    Set-WBSchedule -Policy $save -Schedule 1:00
    Set-WBVssBackupOptions -Policy $save -VssFullBackup
    Set-WBPolicy -Policy $save

    Sauvegarde manuelle:

    Start-WBBackup -Policy (Get-WBPolicy)

    Restauration:

    mkdir C:\Restore
    Start-WBFileRecovery -BackupSet (Get-WBBackupSet) -Recursive -TargetPath C:\Restore -SourcePath "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\"

    BDD Recovery:

    eseutil /mh 'C:\Restore\Mailbox\Mailbox Database 1809077448\Mailbox Database 1809077448.edb'
    eseutil /ml 'C:\Restore\Mailbox\Mailbox Database 1809077448\E00'
    eseutil /r 'E00' /i /l 'C:\Restore\Mailbox\Mailbox Database 1809077448' /d 'C:\Restore\Mailbox\Mailbox Database 1809077448’
    New-MailboxDatabase -Name RecoveryDB -Recovery -Server server1 –EdbFilePath 'C:\Restore\Mailbox\Mailbox Database 1809077448\Mailbox Database 1809077448.edb' -LogFolderPath 'C:\Restore\Mailbox\Mailbox Database 1809077448'
    Restart-Service MSExchangeIS
    Mount-Database -Identity RecoveryDB

    Restauration d'une boite:

    New-MailboxRestoreRequest -SourceDatabase RecoveryDB –SourceStoreMailbox Administrateur -TargetMailbox Administrateur
    New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox Administrateur -TargetMailbox Administrateur -TargetRootFolder Restore
    Restart-Service -Name MSExchangeMailboxReplication

    Droits d'administration:

    New-RoleGroup -Name "Contoso Recipient Management" –Roles $recipientManagement.Roles –RecipientOrganizationalUnitScope "tetras.me/Contoso"
    Add-RoleGroupMember -Identity "Contoso Recipient Management" –Member "Informatique"

    Supprimer des droits:

    Get-ManagementRoleAssignment -RoleAssignee "Contoso Recipient Management" | Format-Table -Property Name,Role
    Remove-ManagementRoleAssignment -Identity "Message Tracking-Contoso Recipient Management"
    Remove-ManagementRoleAssignment -Identity "Migration-Contoso Recipient Management"
    Remove-ManagementRoleAssignment -Identity "Move Mailboxes-Contoso Recipient Management"
    Remove-ManagementRoleAssignment -Identity "Recipient Policies-Contoso Recipient Management"

    Creation d'un droit:

    New-ManagementRoleAssignment -SecurityGroup "Contoso Recipient Management" -Role "Security Group Creation and Membership"

    New-RoleGroup -Name "Contoso Distribution Groups Management" –Role "Distribution Groups","Security Group Creation and Membership" -RecipientOrganizationalUnitScope "tetras.me/Contoso"
    Add-RoleGroupMember -Identity "Contoso Distribution Groups Management" -Member 'Direction'

    Autorisation gestion de serveur:

    New-ManagementScope -Name "Default-First-Site-Name Scope" -ServerRestrictionFilter { ServerSite -eq "CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=tetras,DC=me" }
    New-RoleGroup -Name "Default-First-Site-Name Group Management" -CustomConfigWriteScope "Default-First-Site-Name Scope" -Roles "ExchangeServers","Databases","Database Copies"
    Add-RoleGroupMember -Identity "Default-First-Site-Name Group Management" -Member "Informatique"

    Nouveau role assignement:

    New-RoleAssignmentPolicy -Name "Contoso Role Assignement" –Roles myContactInformation,myProfileInformation,MyBaseOptions
    Get-Mailbox -OrganizationalUnit tetras.me/Contoso | Set-Mailbox -RoleAssignmentPolicy "Contoso Role Assignement"

    OWA stratéfie d'acces:

    New-OwaMailboxPolicy -Name "Contoso"

    Gestion des fonctionnalités OWA:

    Set-OwaMailboxPolicy -Identity "Contoso" -InstantMessagingEnabled $false -UMIntegrationEnabled $false -ContactsEnabled $false -AllowCopyContactsToDeviceAddressBook $false -AllAddressListsEnabled $false -JournalEnabled $false -NotesEnabled $false -SignaturesEnabled $false -ThemeSelectionEnabled $false -CalendarEnabled $false -TasksEnabled $false -RemindersAndNotificationsEnabled $false

    Get-Mailbox -OrganizationalUnit tetras.me/Contoso | Set-CASMailbox -OwaMailboxPolicy "Contoso"

    Stratégie d'accès Active Sync:

    Set-MobileDeviceMailboxPolicy -Identity "Default" -PasswordEnabled $true -RequireDeviceEncryption $true -MinPasswordLength 8
    • ทำเครื่องหมายเป็นคำตอบโดย Love powershell 19 มีนาคม 2561 9:50
    19 มีนาคม 2561 9:47

ตอบทั้งหมด

  • TP1:

    logs:
    $temp = Get-ReceiveConnector
    foreach ($item in $temp)
    {
        Set-ReceiveConnector $item.Id -ProtocolLoggingLevel Verbose
    }
    C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive

    new connector:
    New-SendConnector -Name "To Internet" -AddressSpaces * -Internet -SmartHosts smtp.univ-smb.fr

    règles: new-transportrule

    logs emails:
    Get-MessageTrackingLog -Recipients julien.dumez@etu.univ-smb.fr | Select-Object -Property Timestamp,Sender,MessageSubject,EventID

    DNS:
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "smtp" -CName -HostNameAlias "server01.tetras.me"
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "imap" -CName -HostNameAlias "server01.tetras.me"
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "pop3" -CName -HostNameAlias "server01.tetras.me"
    Add-DnsServerResourceRecord -ZoneName "tetras.me" -Name "autodiscover" -CName -HostNameAlias "server01.tetras.me"

    activer les services:

    Set-Service -Name "msExchangeIMAP4" -StartupType Automatic
    Set-Service -Name "msExchangeIMAP4BE" -StartupType Automatic
    Start-Service -Name "msExchangeIMAP4"
    Start-Service -Name "msExchangeIMAP4BE"

    Set-Service -Name "msExchangePOP3" -StartupType Automatic
    Set-Service -Name "msExchangePOP3BE" -StartupType Automatic
    Start-Service -Name "msExchangePOP3"
    Start-Service -Name "msExchangePOP3BE"

    TP2:

    créer une base de donnée:

    New-MailboxDatabase -Name "BDD5_001" -Server server01.tetras.me -EdbFilePath E:\EDB\BDD5_001.edb
    Restart-Service MSExchangeIS

    Quotas:

    Get-MailboxDatabase | Where-Object { $_.Name -like "BDD5*" } | Set-MailboxDatabase -IssueWarningQuota 4700MB -ProhibitSendQuota 4800MB -ProhibitSendReceiveQuota 5000MB

    Monter une BDD:

    Get-MailboxDatabase | Mount-Database

    Déplacer les boites dans les bdd:

    $users = Get-User
    $users | Where-Object { $_.Department -eq "Direction" } | New-MoveRequest -TargetDatabase BDD15_001

    TP3:

    Ajout boites utilisateurs à partir de fichier CSV:

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://server1.tetras.me/PowerShell/
    Import-PSSession $Session

    $users = Import-Csv -Path "C:\users.csv" -Delimiter ";"

    foreach($user in $users)
    {  
        $prenom = $user.firstname
        $off = $user.Office
        $tel = $user.phone
        $nom = $user.lastname
        $dep = $user.department
        $log = $user.login
        $ou = "OU=contoso,DC=tetras,DC=me"
        $password = ConvertTo-SecureString -String "Password1" -Force -AsPlainText
        
        #Ajout des données dans la base Active Directory
        New-Mailbox -Name $nom -UserPrincipalName "$log@tetras.me" -OrganizationalUnit Contoso -Password $password -FirstName $prenom -LastName $nom -DisplayName "$prenom $nom"
        Set-ADUser -Identity $log -Office $off -OfficePhone $tel –Company Contoso -Department $dep
    }

    Config DNS:

    Add-DnsServerPrimaryZone -Name contoso.com -ReplicationScope Domain
    Add-DnsServerResourceRecordMX -ZoneName contoso.com -Name contoso.com -MailExchange server1.tetras.me -Preference 10

    Autorisation reception des email du domaine:

    New-AcceptedDomain -Name contoso.com -DomainName contoso.com –DomainType Authoritative

    Création d'un utilisateur:

    New-ADOrganizationalUnit -Name "Contoso"
    $password = ConvertTo-SecureString -String "Password1" -Force -AsPlainText
    New-Mailbox -Name juliend -UserPrincipalName julien@tetras.me -OrganizationalUnit Contoso -Password $password -FirstName Julien –LastName DUMEZ -DisplayName "Julien DUMEZ"
    Set-ADUser -Identity julien -Office C274 -OfficePhone 0606474144 –Company Contoso -Department IT

    Création politique d'adressage:

    New-EmailAddressPolicy -Name "contoso.com" -IncludedRecipients AllRecipients –RecipientContainer "Contoso" –EnabledEmailAddressTemplates "smtp:%g@contoso.com","SMTP:%g.%s@contoso.com"
    Update-EmailAddressPolicy -Identity "contoso.com"

    Adresse de redirection:

    Set-Mailbox -Identity julien -DeliverToMailboxAndForward $false -ForwardingSmtpAddress julien.dumez@etu.univ-smb.fr

    Créer un groupe de distribution:

    New-DistributionGroup -Name "ContosoAndCo" -Alias "contoso_and_co" -OrganizationalUnit Contoso
    Add-DistributionGroupMember -Identity "ContosoAndCo" -Member julien

    Liste de distribution dynamique:

    $communication = (Get-Recipient | Where-Object { $_.Department -eq "Communication" })[0]
    New-DynamicDistributionGroup -Name "Tout le monde" -Alias "tout_le_monde" -IncludedRecipients MailboxUsers -RecipientContainer Contoso -ModerationEnabled $true -ModeratedBy $communication.Alias

    Créer des salles de réunion:

     $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://server1.tetras.me/PowerShell/
    Import-PSSession $Session

    for($roomNumber=1; $roomNumber -le 4; $roomNumber++) {
        New-Mailbox -Room -Name "Salle de reunion $roomNumber" -Alias "salle_de_reunion_$roomNumber" -OrganizationalUnit "Contoso"
    }


    Créer des voitures:

    $moderator = Get-Recipient -Identity julien
    for($carNumber=1; $carNumber -le 4; $carNumber++) {
        New-Mailbox -Equipment -Name "Voiture $carNumber" -Alias "voiture_$carNumber" -OrganizationalUnit "Contoso" -ModerationEnabled $true -ModeratedBy $moderator.Alias
    }

    New-AddressList -Name "Toutes les voitures" -RecipientFilter { (RecipientTypeDetails -eq "EquipmentMailbox") -and (Name -like "Voiture *") }
    Update-AddressList -Identity "Toutes les voitures"

    TP4:

    Fonctionnalité backup windows:

    Install-WindowsFeature -Name "Windows-Server-Backup"

    Sauvegarde planifié:

    $save = New-WBPolicy
    Add-WBFileSpec -Policy $save -FileSpec (New-WBFileSpec –FileSpec "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\")
    Add-WBBackupTarget -Policy $save -Target (New-WBBackupTarget –VolumePath E:)
    Set-WBSchedule -Policy $save -Schedule 1:00
    Set-WBVssBackupOptions -Policy $save -VssFullBackup
    Set-WBPolicy -Policy $save

    Sauvegarde manuelle:

    Start-WBBackup -Policy (Get-WBPolicy)

    Restauration:

    mkdir C:\Restore
    Start-WBFileRecovery -BackupSet (Get-WBBackupSet) -Recursive -TargetPath C:\Restore -SourcePath "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\"

    BDD Recovery:

    eseutil /mh 'C:\Restore\Mailbox\Mailbox Database 1809077448\Mailbox Database 1809077448.edb'
    eseutil /ml 'C:\Restore\Mailbox\Mailbox Database 1809077448\E00'
    eseutil /r 'E00' /i /l 'C:\Restore\Mailbox\Mailbox Database 1809077448' /d 'C:\Restore\Mailbox\Mailbox Database 1809077448’
    New-MailboxDatabase -Name RecoveryDB -Recovery -Server server1 –EdbFilePath 'C:\Restore\Mailbox\Mailbox Database 1809077448\Mailbox Database 1809077448.edb' -LogFolderPath 'C:\Restore\Mailbox\Mailbox Database 1809077448'
    Restart-Service MSExchangeIS
    Mount-Database -Identity RecoveryDB

    Restauration d'une boite:

    New-MailboxRestoreRequest -SourceDatabase RecoveryDB –SourceStoreMailbox Administrateur -TargetMailbox Administrateur
    New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox Administrateur -TargetMailbox Administrateur -TargetRootFolder Restore
    Restart-Service -Name MSExchangeMailboxReplication

    Droits d'administration:

    New-RoleGroup -Name "Contoso Recipient Management" –Roles $recipientManagement.Roles –RecipientOrganizationalUnitScope "tetras.me/Contoso"
    Add-RoleGroupMember -Identity "Contoso Recipient Management" –Member "Informatique"

    Supprimer des droits:

    Get-ManagementRoleAssignment -RoleAssignee "Contoso Recipient Management" | Format-Table -Property Name,Role
    Remove-ManagementRoleAssignment -Identity "Message Tracking-Contoso Recipient Management"
    Remove-ManagementRoleAssignment -Identity "Migration-Contoso Recipient Management"
    Remove-ManagementRoleAssignment -Identity "Move Mailboxes-Contoso Recipient Management"
    Remove-ManagementRoleAssignment -Identity "Recipient Policies-Contoso Recipient Management"

    Creation d'un droit:

    New-ManagementRoleAssignment -SecurityGroup "Contoso Recipient Management" -Role "Security Group Creation and Membership"

    New-RoleGroup -Name "Contoso Distribution Groups Management" –Role "Distribution Groups","Security Group Creation and Membership" -RecipientOrganizationalUnitScope "tetras.me/Contoso"
    Add-RoleGroupMember -Identity "Contoso Distribution Groups Management" -Member 'Direction'

    Autorisation gestion de serveur:

    New-ManagementScope -Name "Default-First-Site-Name Scope" -ServerRestrictionFilter { ServerSite -eq "CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=tetras,DC=me" }
    New-RoleGroup -Name "Default-First-Site-Name Group Management" -CustomConfigWriteScope "Default-First-Site-Name Scope" -Roles "ExchangeServers","Databases","Database Copies"
    Add-RoleGroupMember -Identity "Default-First-Site-Name Group Management" -Member "Informatique"

    Nouveau role assignement:

    New-RoleAssignmentPolicy -Name "Contoso Role Assignement" –Roles myContactInformation,myProfileInformation,MyBaseOptions
    Get-Mailbox -OrganizationalUnit tetras.me/Contoso | Set-Mailbox -RoleAssignmentPolicy "Contoso Role Assignement"

    OWA stratéfie d'acces:

    New-OwaMailboxPolicy -Name "Contoso"

    Gestion des fonctionnalités OWA:

    Set-OwaMailboxPolicy -Identity "Contoso" -InstantMessagingEnabled $false -UMIntegrationEnabled $false -ContactsEnabled $false -AllowCopyContactsToDeviceAddressBook $false -AllAddressListsEnabled $false -JournalEnabled $false -NotesEnabled $false -SignaturesEnabled $false -ThemeSelectionEnabled $false -CalendarEnabled $false -TasksEnabled $false -RemindersAndNotificationsEnabled $false

    Get-Mailbox -OrganizationalUnit tetras.me/Contoso | Set-CASMailbox -OwaMailboxPolicy "Contoso"

    Stratégie d'accès Active Sync:

    Set-MobileDeviceMailboxPolicy -Identity "Default" -PasswordEnabled $true -RequireDeviceEncryption $true -MinPasswordLength 8
    • ทำเครื่องหมายเป็นคำตอบโดย Love powershell 19 มีนาคม 2561 9:50
    19 มีนาคม 2561 9:47