office365 添加guest account

2018-11-13  本文已影响0人  山猪cn

office365 admin center 并不能添加guest用户,只能删除。添加guest用户,需要登录Azure ad portal。

office365 admin center

登录Azure ad 邀请添加guest

但是这样做之后,仅仅能够将guest用户加入office365 group,而无法将其加入distribution group

将guest用户加入distribution group

关键命令:

#asks for office 365 credentials and stores them in

$UserCredentials$UserCredential = Get-Credential

#sets remote execution policy

Set-ExecutionPolicy RemoteSigned

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

# User prompts

$member = read-host -Prompt "Member [name_domain#EXT#]"

$identity = read-host -Prompt "DL Identity"

# add to DL

Add-DistributionGroupMember -Identity $identity -Member $member

# wait for user to hit any key incase there is an error

Write-Host -NoNewLine 'Press any key to continue...';

$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');

图例:

guest用户在office的安全策略设置

上一篇 下一篇

猜你喜欢

热点阅读