教えて!HELPDESK      Excel     Word      Outlook      Power Point      Windows

 

ExchangeOnline(V2) PowerShell:使えるコマンド集

 

 

 

 

まずはExchange Onlineに接続

Connect-ExchangeOnline -UserPrincipalName AdminUser@xx.com

※Connect-ExchangeOnline入力後サインイン画面に入力してもOK

 


UserAのメールボックスのアクセス権を表示

Get-EXOMailboxPermission -Identity UserA@xx.com

↓結果↓のように返されます(tanakaとyamadaが フルアクセス権限を持っていることがわかる)

Identity : UserA
User :
tanaka@xx.com
AccessRights :
{FullAccess}

 

Identity : UserA
User :
yamada@xx.com
AccessRights :
{FullAccess}

 


UserAのメールボックスにフルアクセス権を持つユーザーを一覧表示

Get-EXOMailboxPermission UserA@xx.com |? {$_.AccessRights -eq "FullAccess"} |select user,AccessRights

↓結果↓のように返されます(tanakaとyamadaがフルアクセス持つ)

User AccessRights
---- ------------
NT AUTHORITY\SELF {FullAccess, ReadPermission}
tanaka@xx.com{FullAccess}
yamada@xx.com {FullAccess}

 


UserAのメールボックスからフルアクセス権を持つユーザー(yamada)を削除

Remove-MailboxPermission -Identity UserA@x.com -User yamada@x.com -AccessRights FullAccess -InheritanceType All

↓結果↓のように返されます

Confirm
Are you sure you want to perform this action?
アクセス権 "'FullAccess'" を持つユーザー "yamada@x.com" に対して、メールボックスのアクセス許可 Id
を削除しています: "UserA@x.com"
[Y] Yes [A] Yes to All [N] No [L] No to All [?] ヘルプ (既定値は "Y"):
Y

※削除されたか確認するにはGet-EXOMailboxPermission UserA@x.com |? {$_.AccessRights -eq "FullAccess"} |select user,AccessRights

 


メールボックス情報を表示

Get-EXOMailbox -Identity UserA@xx.com |fl

 


ルールを表示

Get-InboxRule -Mailbox UserA@xx.com

 


ルールを全削除

Get-InboxRule -Mailbox UserA@xx.com | Remove-InboxRule

↓↓

Confirm
 Are you sure you want to perform this action?
 メールボックス "A"から受信トレイルール ID:"A\1346203441154"を削除しています。
[Y] Yes [A] Yes to All [N] No [L] No to All [?] ヘルプ (既定値は "Y"): Y

 


所有者送信権限(SENDAS)を割り当てる(Aの名前でBが送信できる)

Add-RecipientPermission -Identity "A@xx.com" -Trustee "B@xx.com" -AccessRights SendAs

↓結果↓B@xx.comがSENDAS権限を貰う人。

Confirm
Are you sure you want to perform this action?
受信者 ID: "A@xx.com" のユーザーまたはグループ "B@xx.com" に対する受信者アクセス許可'SendAs' を追加しています。
[Y] Yes [A] Yes to All [N] No [L] No to All [?] ヘルプ (既定値は "Y"): Y
Identity Trustee AccessControlType AccessRights Inherited

 


所有者送信権限(SENDAS)持つユーザーを一覧表示する

Get-EXORecipientPermission -Identity "A@xx.com" |? {$_.AccessRights -eq "Sendas"} |select trustee,AccessRights

↓結果↓A@xx.comの名前で送信できるユーザー3名↓

Trustee AccessRights
------- ------------
NT AUTHORITY\SELF {SendAs}
b@xx.com {SendAs}
c@xx.com {SendAs}
d@xx.com {SendAs}


所有者送信権限(SENDAS)持つユーザーを削除する

 

メールアドレスAの送信者権限を持つユーザーBを削除

 Remove-RecipientPermission -Identity A@.com -Trustee B@.com -AccessRights SendAs

 

 

 

 

教えて!HELPDESK      Excel     Word      Outlook      Power Point      Windows