powershell [Manipulandousuários通过PowerShell执行Office 365] Comandos para manipular o Office 365.

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell [Manipulandousuários通过PowerShell执行Office 365] Comandos para manipular o Office 365. 相关的知识,希望对你有一定的参考价值。

Get-MsolAccountSku
(Get-MsolAccountSku | where {$_.AccountSkuId -eq "reseller-account:O365_BUSINESS_PREMIUM"}).ServiceStatus
Set-MsolUser -UserPrincipalName pedro.castro@hobrasil.com.br -BlockCredential $true
Get-MsolUser -UserPrincipalName pedro.castro@hobrasil.com.br | Select DisplayName,BlockCredential
#Accounts.txt :
#akol@contoso.com
#tjohnston@contoso.com
#kakers@contoso.com
Get-Content Accounts.txt | ForEach { Set-MsolUser -UserPrincipalName $_ -BlockCredential $true }
Get-Command -Verb Get
Get-Command -Noun Service
Get-MsolUser -All | where {$_.isLicensed -eq $true -and $_.Licenses[0].ServiceStatus[5].ProvisioningStatus -ne "Disabled" -and $_.Licenses[0].ServiceStatus[8].ProvisioningStatus -ne "Disabled"}
Get-MsolUser -UserPrincipalName "sergio.queiroz@hobrasil.com.br" | Select-Object *
Get-MsolUser -All -UnlicensedUsersOnly
Get-MsolUser -All | where {$_.UsageLocation -eq $null}
Get-MsolUser -All -Department "Marketing" -UsageLocation "BR" -UnlicensedUsersOnly
Get-MsolUser -UserPrincipalName "sergio.queiroz@hobrasil.com.br" | Select-Object UsageLocation
Get-MsolUser -UserPrincipalName "sergio.queiroz@hobrasil.com.br" | Format-List DisplayName,Licenses
(Get-MsolUser -UserPrincipalName "sergio.queiroz@hobrasil.com.br").Licenses.ServiceStatus
Get-MsolUser -All -ReturnDeletedUsers
$userAccountUPN="sergio.queiroz@hobrasil.com.br"
$AllLicenses=(Get-MsolUser -UserPrincipalName $userAccountUPN).Licenses
$licArray = @()
for($i = 0; $i -lt $AllLicenses.Count; $i++)
{
  $licArray += "License: " + $AllLicenses[$i].AccountSkuId
  $licArray +=  $AllLicenses[$i].ServiceStatus
  $licArray +=  ""
}
$licArray
Install-Module -Name AzureAD
Connect-AzureAD
Install-Module MSOnline
Connect-MsolService
New-MsolUser -DisplayName "Sergio Carvalho Queiroz" -FirstName "Sergio" -LastName "Queiroz" -UserPrincipalName "sergio.queiroz@hobrasil.com.br" -UsageLocation "BR" -LicenseAssignment "reseller-account:SPE_F1"
Remove-MsolUser -UserPrincipalName "sergio.queiroz@hobrasil.com.br"
Set-MsolUserLicense -UserPrincipalName "sergio.queiroz@hobrasil.com.br" -AddLicenses "reseller-account:POWER_BI_PRO"
Get-MsolUser -All -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "reseller-account:SPE_F1"
Connect-AzureAD
Connect-MsolService
Set-MsolUser -UserPrincipalName "sergio.queiroz@hobrasil.com.br" -Title "Coordenador de TI"

以上是关于powershell [Manipulandousuários通过PowerShell执行Office 365] Comandos para manipular o Office 365. 的主要内容,如果未能解决你的问题,请参考以下文章

powershell PowerShell:启动PowerShell作为其他用户提升

powershell [提示输入powershell] #powershell #input #prompt

powershell 测量PowerShell命令或PowerShell脚本的速度

powershell远程下载exe并执行

powershell 使用啥端口

如何在不卸载powershell的情况下,有效禁用/启用powershel