Get-ServicePrincipal [[-Identity] <ServicePrincipalIdParameter>] [-Organization <OrganizationIdParameter>] [<CommonParameters>] 说明 Azure Active Directory 中存在服务主体,用于定义应用可以执行哪些操作、谁可以访问应用以及应用可以访问哪些资源。 在Exchange Online中,服务主体是对 Azure AD 中服务主体的引用。
通过提供ServicePrincipalId、ClientId和TenantId的正确值来运行以下命令。 PowerShell $ClientCertificate=Get-ChildItem-Pathcert:\CurrentUser\my\ |Where-Object{$_.Subject-eq"CN=CSV2SCIM"}$ThumbPrint=$ClientCertificate.ThumbPrint .\CSV2SCIM.ps1-Path'..\Samples\csv-with-2-records.csv'-AttributeMapping$...
'Owner_ObjectID' = $OwnerID } } foreach ($Cert in $Certs) { $StartDate = $Cert.StartDateTime $EndDate = $Cert.EndDateTime $CertName = $Cert.DisplayName $Owner = Get-MgServicePrincipalOwner -ServicePrincipalId $EnterpriseApp.Id $Username = $Owner.AdditionalPropert...
$serverServicePrincipalObjectId= (Get-MgServicePrincipal-Filter"DisplayName eq '$applicationName'").Id 备注 应用程序的显示名称不是唯一的,因此,应验证是否获取了正确的应用程序服务主体。 将应用角色添加到步骤 3 中创建的应用程序。 可以使用 Azure 门户或使用 Microsoft Graph 来创建角色。 ...
PowerShell使用ServicePrincipal登陆Azure 一、打开PowerShell 二、输入下列命令 $pass = ConvertTo-SecureString"<这里换成您的AAD应用密钥>"-AsPlainText –Force $cred= New-Object -TypeName pscredential –ArgumentList"<这里换成您的AAD应用ID>", $pass...
Windows 7 Service Pack 1 (SP1)* Windows Server 2008 R2 SP1* * 需要安装 Microsoft .NET Framework 4.5。x,然后Windows Management Framework 3.0 或 4.0。 有关详细信息,请参阅Windows Management Framework。 需要安装Microsoft Entra ID、Exchange Online、Defender for Office 365、Microsoft Purview 合规性、...
Get-MgUser-SelectId,DisplayName,Mail,UserPrincipalName,UsageLocation,UserType | where {$_.UsageLocation-eq$null-and$_.UserType-eq'Member'} 若要设置帐户的UsageLocation值,请运行此命令。 PowerShell $userUPN="<user sign-in name (UPN)>"$userLoc="<ISO 3166-1 alpha-2 country code>"Update-Mg...
$tenantId = Get-AzureSubscription | ` Where {$_.IsCurrent -eq "True"} | ` Select TenantId$appPrincipalId = (Get-MsolServicePrincipal -ServicePrincipalName $servicePrincipalName).AppPrincipalId$secureCredential = ` New-Object System.Management.Automation.PSCredential ($appPr...
可以使用Get-Service和Set-Service等操作Windows服务。 注: 查询Windows服务状态不需要管理员权限,操作Windows服务(停止、开启等)需要管理员权限。 1.1 查询Windows服务状态 查询本地WinRM服务状态 Get-Service -Name "WinRM" Get-CimInstance -ClassName Win32_service | where {$_.Name -eq "WinRM"} ...
使用Get-AzureADServiceAppRoleAssignment 获取服务主体应用程序的角色分配,包含User 和 Group 信息。 使用Get-AzureADUser 从 Microsoft Entra ID 获取用户的信息信息,包含 DisplayName, UserPrincipalName, AccountEnabled,createdDateTime 和 employeeId 如果返回的结果中存在多重对象关系,可以使用 $_.{第一层属性名}....