简体   繁体   English

O365 Powershell 供客户使用

[英]O365 Powershell for customers

I am currently using O365 Graph API to create services for customers and realized that some of the capabilities that customers need, ie creating transport rules or accessing quarantined email information, are only available through PowerShell.我目前正在使用 O365 Graph API 为客户创建服务,并意识到客户需要的一些功能,即创建传输规则或访问隔离的 email 信息,只能通过 Z3D265B4E1EEEF0DDF17881FA003 获得。

Can a vendor create transport rules or execute PowerShell commands for their customers?供应商能否为其客户创建传输规则或执行 PowerShell 命令? Similar to how vendors register their Azure AD application and request permissions, is there a way to run PowerShell command for customers by a vendor?类似于供应商如何注册他们的 Azure AD 应用程序并请求权限,有没有办法让供应商为客户运行 PowerShell 命令?

Documentation is not really helpful on this front.文档在这方面并没有真正的帮助。

When using Graph, I don't think you can, but if you want to do it with Powershell, if you're a Microsoft Partner, and have configured yourself as an advisor (delegated access permissions) for your clients (invite them to add you, or add yourself if you have their consent and global admin access to their tenancy).使用 Graph 时,我认为您不能,但如果您想使用 Powershell,如果您是 Microsoft 合作伙伴,并且已将自己配置为客户的顾问(委托访问权限)(邀请他们添加您,或添加您自己,如果您已获得他们的同意和对他们的租约的全局管理员访问权限)。

Adding a partner to a tenant:向租户添加合作伙伴:

https://docs.microsoft.com/en-us/partner-center/customers_revoke_admin_privileges https://docs.microsoft.com/en-us/partner-center/customers_revoke_admin_privileges

See a bit of additional info here:在此处查看一些附加信息:

https://docs.microsoft.com/en-us/office365/enterprise/powershell/manage-office-365-tenants-with-windows-powershell-for-delegated-access-permissio https://docs.microsoft.com/en-us/office365/enterprise/powershell/manage-office-365-tenants-with-windows-powershell-for-delegated-access-permissio

When running Powershell commands, you'll need to refer to the TenantID when running a command on the client's tenancy (rather than your own).在运行 Powershell 命令时,在客户端的租户(而不是您自己的)上运行命令时,您需要参考租户 ID。

A simple example of this might be:一个简单的例子可能是:

Get a list of TenantIDs:获取 TenantID 列表:

Get-MsolPartnerContract -All | Select-Object TenantId

Get a list of mailboxes for one of the TenantIds listed above:获取上面列出的其中一个 TenantId 的邮箱列表:

Get-Mailbox -TenantID "asddfsdfadfg-dsfgsdfg-sdfgsdfg-dsfgsdfg"

This relies on you having logged into the Powershell session with a user that has administrative 'Partner' permissions in your partner tenancy.这取决于您使用在您的合作伙伴租赁中具有管理“合作伙伴”权限的用户登录 Powershell session。

Hopefully that helps somewhat!希望这有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM