ค้นหาเว็บไซต์

ส่งออกสิทธิ์กล่องจดหมายเป็นไฟล์ CSV


เราต้องการส่งออกการอนุญาตกล่องจดหมายไปยังไฟล์ CSV ใน Exchange Server นั่นเป็นเพราะว่าบริษัทกำลังควบรวมกิจการกับบริษัทอื่นและพวกเขาขอให้เราตรวจสอบการอนุญาตกล่องจดหมายทุกกล่อง เหล่านี้คือกล่องจดหมายและสิทธิ์ของกล่องจดหมายที่ใช้ร่วมกัน เราสามารถลงชื่อเข้าใช้ Exchange Admin Center และเปิดทุกกล่องจดหมายและจดสิทธิ์ของผู้ใช้ได้ นั่นคงต้องใช้เวลา จะเป็นอย่างไรถ้าเราสามารถใช้สคริปต์ที่ทรงพลังที่สามารถทำงานให้เราได้? ในบทความนี้ คุณจะได้เรียนรู้วิธีส่งออกการอนุญาตกล่องจดหมายเป็นไฟล์ CSV

ส่งออกสิทธิ์กล่องจดหมายสคริปต์ PowerShell

สคริปต์จะสแกนฐานข้อมูลกล่องจดหมายและตรวจสอบกล่องจดหมายทีละรายการ มันจะถ่ายโอนข้อมูลทุกอย่างที่ทำไปยังไฟล์ข้อความและส่งออกสิทธิ์ไปยังไฟล์ CSV ความคืบหน้าอาจต้องใช้เวลา เนื่องจากขึ้นอยู่กับขนาดองค์กร Exchange ในตัวอย่างของฉัน สคริปต์ใช้เวลาทำงาน 89 วินาที สแกนได้ทั้งหมด 38 รายการ

สคริปต์จะตรวจสอบการอนุญาตดังต่อไปนี้:

  • กล่องจดหมาย

  • กลุ่มการจัดจำหน่าย

  • กล่องจดหมายของทรัพยากร

  • กล่องจดหมายที่ใช้ร่วมกัน

สคริปต์จะส่งออกสิทธิ์กล่องจดหมาย Exchange ต่อไปนี้ไปยังไฟล์ CSV:

  • ส่งเป็น

  • การเข้าถึงแบบเต็ม

  • ส่งในนาม

ไฟล์ CSV ที่ส่งออกจะมีข้อมูลต่อไปนี้สำหรับการอนุญาตกล่องจดหมายแต่ละรายการ:

  • ชื่อที่แสดง

  • ที่อยู่ SMTP หลัก

  • สิทธิ์การเข้าถึงแบบเต็ม

  • ส่งเป็นสิทธิ์

  • ส่งการอนุญาตในนามของ

ตอนนี้เราได้ดูแล้วว่าสคริปต์ทำอะไรได้บ้าง ขั้นตอนต่อไปคือการดาวน์โหลดและตั้งค่า หลังจากนั้นเราจะเรียกใช้สคริปต์และตรวจสอบผลลัพธ์ที่ส่งออก

เตรียมสคริปต์สิทธิ์กล่องจดหมาย Exchange ส่งออก

ดาวน์โหลดสคริปต์ PowerShell ที่สร้างโดย Samuel F. Drey จากที่นี่ (ลิงก์โดยตรง) หรือที่นี่ (GitHub) หากไม่แจ้งให้คุณบันทึกไฟล์ ให้คลิกขวาที่ Export-MailboxFASAPermissions.ps1 แล้วคลิกบันทึกลิงก์เป็น คุณควรจะสามารถบันทึกสคริปต์ได้ วางสคริปต์ไว้ในโฟลเดอร์ C:\scripts สร้างโฟลเดอร์สคริปต์หากคุณไม่มี

ส่งออกสิทธิ์กล่องจดหมายเป็นไฟล์ CSV

ลงชื่อเข้าใช้ Exchange Server และเรียกใช้ Exchange Management Shell ในฐานะผู้ดูแลระบบ cmdlet เริ่มต้นกำลังจะส่งออกสิทธิ์ของกล่องจดหมายทั้งหมด เหล่านี้คือกล่องจดหมาย กลุ่มการแจกจ่าย กล่องจดหมายของทรัพยากร และกล่องจดหมายที่ใช้ร่วมกัน

เปลี่ยนเส้นทางไปยังไดเร็กทอรีสคริปต์และรันสคริปต์

[PS] C:\>cd scripts
[PS] C:\scripts>.\Export-MailboxFASAPermissions.ps1
********************** Beginning execution ***********************
Testing if Exchange tools are present

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-Mailbox                                        1.0        ex01-2016.exoip.local
Exchange tools are present !
True
Exchange Tools present ! continuing to test if user specified Output file
Not Output file specified, using the script standard name C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-20-22-28-
02.csv
Checking if user specified -DistributionGroupsOnly switch...
Beginning routing to dump mailbox Send As, Full Access, and Send On Behalf permissions
Getting all databases
Processing Database DB01
The full mailbox command launched is :
Get-Mailbox -resultsize unlimited -database "DB01"
Parsing 37 mailboxes...
Working on mailbox Amanda Morgan which Primary SMTP is Amanda.Morgan@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
Found one or more SendOnBehalf Permission ! Dumping ...
Working on mailbox Christopher Payne which Primary SMTP is Christopher.Payne@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
Found one or more SendOnBehalf Permission ! Dumping ...
Working on mailbox Mary Walsh which Primary SMTP is Mary.Walsh@exoip.com
No custom Send As permissions detected
No custom Full Access permissions detected
No custom SendOnBehalf permissions detected

หลังจากสคริปต์เสร็จสิ้น ไฟล์ CSV จะปรากฏขึ้น

ตรวจสอบสิทธิ์ในไฟล์ CSV

สคริปต์จะสร้างไฟล์สองไฟล์หลังจากส่งออกสิทธิ์ ค้นหาไฟล์ CSV ที่ส่งออก

เปิดไฟล์ CSV ด้วยโปรแกรมที่คุณชื่นชอบ ฉันใช้ไมโครซอฟต์เอ็กเซล เราสามารถดูการอนุญาตกล่องจดหมายในมุมมองที่ง่าย

ส่งออกสิทธิ์กล่องจดหมายของผู้ใช้ที่เลือกหรือผู้ใช้

จะเกิดอะไรขึ้นหากเราต้องการส่งออกสิทธิ์ของกล่องจดหมายสำหรับผู้ใช้รายเดียวหรือหลายราย หากเราเรียกใช้ cmdlet ข้างต้น มันจะค้นหาทั้งองค์กรและจะต้องใช้เวลา ฉันได้พูดคุยกับผู้เขียนบทและเขาก็ช่วยอัปเดตสคริปต์ได้ เขาได้สร้างพารามิเตอร์ -MailboxList ใหม่ขึ้นมา เราจะใช้พารามิเตอร์นั้นและเพิ่มชื่อผู้ใช้ที่เราต้องการส่งออกการอนุญาต

[PS] C:\scripts>.\Export-MailboxFASAPermissions.ps1 -MailboxList "Christopher Payne"
********************** Beginning execution ***********************
Testing if Exchange tools are present

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-Mailbox                                        1.0        ex01-2016.exoip.local
Exchange tools are present !
True
Exchange Tools present ! continuing to test if user specified Output file
Not Output file specified, using the script standard name C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-00-47-47.csv
Checking if user specified -DistributionGroupsOnly switch...
Using -MailboxList parameter, checking mailboxes from that list (1 mailboxes in the list)
Processing mailbox Christopher Payne
SUCCESS - Successfully located mailbox Christopher Payne : its primary SMTP address is : Christopher.Payne@exoip.com
Working on mailbox Christopher Payne which Primary SMTP is Christopher.Payne@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
Found one or more SendOnBehalf Permission ! Dumping ...
saving file in C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-00-47-47.csv


The script took 2.5061906 seconds to execute...

หากเราต้องการส่งออกสิทธิ์ของผู้ใช้มากกว่าหนึ่งราย เราจำเป็นต้องเพิ่มผู้ใช้โดย คั่นด้วยเครื่องหมายจุลภาค

[PS] C:\scripts>.\Export-MailboxFASAPermissions.ps1 -MailboxList "Christopher Payne", "Emma Underwood"
********************** Beginning execution ***********************
Testing if Exchange tools are present

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-Mailbox                                        1.0        ex01-2016.exoip.local
Exchange tools are present !
True
Exchange Tools present ! continuing to test if user specified Output file
Not Output file specified, using the script standard name C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-00-48-28.csv
Checking if user specified -DistributionGroupsOnly switch...
Using -MailboxList parameter, checking mailboxes from that list (2 mailboxes in the list)
Processing mailbox Christopher Payne
SUCCESS - Successfully located mailbox Christopher Payne : its primary SMTP address is : Christopher.Payne@exoip.com
Working on mailbox Christopher Payne which Primary SMTP is Christopher.Payne@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
Found one or more SendOnBehalf Permission ! Dumping ...
Processing mailbox Emma Underwood
SUCCESS - Successfully located mailbox Emma Underwood : its primary SMTP address is : Emma.Underwood@exoip.com
Working on mailbox Emma Underwood which Primary SMTP is Emma.Underwood@exoip.com
No custom Send As permissions detected
No custom Full Access permissions detected
No custom SendOnBehalf permissions detected
saving file in C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-00-48-28.csv


The script took 4.8661493 seconds to execute...

ส่งออกการอนุญาตกล่องจดหมายที่ใช้ร่วมกันเป็นไฟล์ CSV

ในส่วนแรกเราได้เห็นวิธีการส่งออกสิทธิ์ของกล่องจดหมายทั้งหมดแล้ว ในส่วนที่สอง เราได้ส่งออกสิทธิ์ของผู้ใช้รายเดียวหรือผู้ใช้ที่ระบุ เป็นไปได้ที่จะส่งออกเฉพาะการอนุญาตกล่องจดหมายที่ใช้ร่วมกันเท่านั้น

ลองใช้พารามิเตอร์ -SharedMailboxes กันดีกว่า

[PS] C:\scripts>.\Export-MailboxFASAPermissions.ps1 -SharedMailboxes
********************** Beginning execution ***********************
Testing if Exchange tools are present

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-Mailbox                                        1.0        ex01-2016.exoip.local
Exchange tools are present !
True
Exchange Tools present ! continuing to test if user specified Output file
Not Output file specified, using the script standard name C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-22-12-
30.csv
Checking if user specified -DistributionGroupsOnly switch...
Beginning routing to dump mailbox Send As, Full Access, and Send On Behalf permissions
Getting all databases
Processing Database DB01
Specified Resource Mailboxes parameter ? False
Specified SharedMailboxes parameter ? True
The full mailbox command launched is :
Get-Mailbox -resultsize unlimited -database "DB01" -RecipientTypeDetails SharedMailbox
Parsing 3 mailboxes...
Working on mailbox Shared Info which Primary SMTP is sharedinfo@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
No custom SendOnBehalf permissions detected
Working on mailbox Shared Sales which Primary SMTP is sharedsales@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
No custom SendOnBehalf permissions detected
Working on mailbox Shared HR which Primary SMTP is sharedhr@exoip.com
Found one or more SendAs Permission ! Dumping ...
Found one or more Full Access Permission ! Dumping ...
No custom SendOnBehalf permissions detected
saving file in C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-22-12-30.csv


The script took 7.904148 seconds to execute...

ส่งออกสิทธิ์กล่องจดหมายของทรัพยากรเป็นไฟล์ CSV

จะเกิดอะไรขึ้นถ้าเราเพียงต้องการส่งออกสิทธิ์กล่องจดหมายของทรัพยากรเท่านั้น

เราสามารถใช้พารามิเตอร์ -ResourceMailboxes ได้

[PS] C:\scripts>.\Export-MailboxFASAPermissions.ps1 -DistributionGroupsOnly
********************** Beginning execution ***********************
Testing if Exchange tools are present

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-Mailbox                                        1.0        ex01-2016.exoip.local
Exchange tools are present !
True
Exchange Tools present ! continuing to test if user specified Output file
Not Output file specified, using the script standard name C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-22-40-28.csv
Checking if user specified -DistributionGroupsOnly switch...
User specified the -DistribugionGroupsOnly switch. Beginning Distribution Groups SendAs / GrantSendOnBehalfTo permissions dump...
Getting all distribution Groups
Testing whether the user set the -IncludeDynamic boolean parameter to $false ($true by default)
User didn't specify the -IncludeDynamic or set -IncludeDynamic to $false - including Dynamic DLs
Working on Distribution Group Management which Primary SMTP is Management@exoip.com
No custom Send As permissions detected
Found one or more SendOnBehalf Permission ! Dumping ...
saving file in C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-21-22-40-28.csv


The script took 2.8954808 seconds to execute...

ส่งออกสิทธิ์ของกลุ่มการแจกจ่ายเป็นไฟล์ CSV

สุดท้ายนี้ เราต้องการส่งออกสิทธิ์ของกลุ่มการแจกจ่ายเป็นไฟล์ CSV

เราสามารถใช้พารามิเตอร์ -DistributionGroupsOnly

[PS] C:\scripts>.\Export-MailboxFASAPermissions.ps1 -DistributionGroupsOnly
********************** Beginning execution ***********************
Testing if Exchange tools are present

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-Mailbox                                        1.0        ex01-2016.exoip.local
Exchange tools are present !
True
Exchange Tools present ! continuing to test if user specified Output file
Not Output file specified, using the script standard name C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-20-22-45-18.csv
Checking if user specified -DistributionGroupsOnly switch...
User specified the -DistribugionGroupsOnly switch. Beginning Distribution Groups SendAs / GrantSendOnBehalfTo permissions dump...
Getting all distribution Groups
Testing whether the user set the -IncludeDynamic boolean parameter to $false ($true by default)
User didn't specify the -IncludeDynamic or set -IncludeDynamic to $false - including Dynamic DLs
Working on Distribution Group Management which Primary SMTP is Management@exoip.com
No custom Send As permissions detected
Found one or more SendOnBehalf Permission ! Dumping ...
saving file in C:\scripts\Export-MailboxFASAPermissions.ps1_2020-05-20-22-45-18.csv


The script took 2.259128 seconds to execute...

ตอนนี้คุณรู้วิธีส่งออกการอนุญาตกล่องจดหมายเป็นไฟล์ CSV แล้ว คุณจะใช้สคริปต์หรือไม่

บทสรุป

ในบทความนี้ คุณได้เรียนรู้วิธีส่งออกสิทธิ์ของกล่องจดหมายเป็นไฟล์ CSV มันเป็นสคริปต์ที่ยอดเยี่ยม และฉันขอแนะนำให้คุณใช้มันหากคุณต้องการส่งออก ครั้งถัดไปที่คุณต้องการตรวจสอบองค์กร Exchange อย่าลืมตรวจสอบสิทธิ์ด้วยสคริปต์

คุณสนุกกับบทความนี้หรือไม่? คุณอาจต้องการอ่านการติดตั้ง Exchange Cumulative Update อย่าลืมติดตามเราและแบ่งปันบทความนี้

บทความที่เกี่ยวข้อง