如果你是执行客户评估的 Microsoft 员工或合作伙伴,请参阅 Wiki 中的评估指南。
如果遇到任何错误,请参阅本文档末尾的常见问题解答部分。
Install-Module AzureADAssessment -Force -Scope CurrentUser
## If you have already installed the module, run the following instead to ensure you have the latest version.
Update-Module AzureADAssessment -Force -Scope CurrentUser
该评估要求在租户中创建自定义应用。
https://login.microsoftonline.com/common/oauth2/nativeclient可以从任何可访问 Azure AD 的客户端运行来自 Azure AD 的数据收集。但是,来自混合组件(例如 AD FS、AAD Connect 等)的数据收集最好在这些服务器上本地运行。AAD Connect 数据收集需要在主服务器和暂存服务器上运行。
验证你拥有访问这些工作负载的授权凭据:
首次连接时,系统会要求你同意评估所需的权限。需要管理员提供同意。
运行以下命令以生成完成评估所需的全部 Azure AD 数据包。
## Authenticate using a Global Admin or Global Reader account.
Connect-AADAssessment -ClientId "AppId of app created in the previous step"
## Export data to "C:\AzureADAssessment" into a single output package.
Invoke-AADAssessmentDataCollection
输出包将按照以下模式命名:AzureADAssessmentData-<TenantDomain>.aad
如果数据收集命令在完成前失败,请尝试使用 SkipReportOutput 参数重新运行。
Invoke-AADAssessmentDataCollection -SkipReportOutput
在每台运行混合组件的服务器上,安装相同的模块并运行 Invoke-AADAssessmentHybridDataCollection 命令。
## Export Data to "C:\AzureADAssessment" into a single output package.
Invoke-AADAssessmentHybridDataCollection
输出包将按照以下模式命名:AzureADAssessmentData-<Svc>-<ServerName>.zip
数据收集完成后,将输出包提供给完成评估的人员。请勿对生成的文件(包括文件名)进行任何更改。
如果你自行生成并查看输出,请参阅 Wiki 中的评估指南。
要从混合组件(如 AAD Connect、AD FS、AAD 应用代理)收集数据,你可以导出此模块的便携版本,以便轻松复制到没有互联网连接的服务器。
## Export Portable Module to "C:\AzureADAssessment".
Export-AADAssessmentPortableModule "C:\AzureADAssessment"
在每台运行混合组件的服务器上,将模块文件 "AzureADAssessmentPortable.psm1" 复制并导入到该服务器。
## Import the module on each server running hybrid components.
Import-Module "C:\AzureADAssessment\AzureADAssessmentPortable.psm1"
## Export Data to "C:\AzureADAssessment" into a single output package.
Invoke-AADAssessmentHybridDataCollection
## If you would like to specify a different directory, use the OutputDirectory parameter.
Invoke-AADAssessmentDataCollection "C:\Temp"
Invoke-AADAssessmentHybridDataCollection "C:\Temp"
如果你希望出于自动化目的使用自己的应用注册(服务主体),可以使用自己的 ClientId 和证书进行连接,如下例所示。你的应用注册应包含对 MS Graph 的 Directory.Read.All、Policy.Read.All 和 AuditLog.Read.All 应用程序权限,以便进行完整评估。添加后,请确保你已在服务主体上完成这些权限的管理员同意。
## Connect using Service Principal identity with app permissions.
Connect-AADAssessment -ClientId <ClientId> -ClientCertificate (Get-Item 'Cert:\CurrentUser\My\<Thumbprint>') -TenantId <TenantId>
你必须先在租户中创建应用注册,并在运行 Connect-AADAssessment 时提供 ClientId。只要为云环境定义正确的重定向 URI,默认应用程序配置即可正常工作。例如,"移动和桌面应用程序"的重定向 URI 为 https://login.microsoftonline.us/common/oauth2/nativeclient。
## Example connecting to USGov cloud environment using user delegated permissions.
Connect-AADAssessment -ClientId <ClientId> -CloudEnvironment USGov -TenantId <TenantId>
## Example connecting to USGov cloud environment using app permissions.
Connect-AADAssessment -ClientId <ClientId> -ClientCertificate (Get-Item 'Cert:\CurrentUser\My\<Thumbprint>') -CloudEnvironment USGov -TenantId <TenantId>
在尝试重新安装 AzureADAssessment 模块之前,运行以下命令将 PowerShellGet 更新到最新版本。选项 1 是执行脚本(https://aka.ms/Update-PowerShellGet)的单个命令,而选项 2 需要多个命令,并且可能需要进行一些故障排除。
### Option 1: Run the following command to download and execute a script to update PowerShellGet. Note: Navigate to this URL in a web browser to see the contents of the script in GitHub.
iex $(irm 'https://aka.ms/Update-PowerShellGet')
### Option 2: Run the following commands individually.
## Update Nuget Package and PowerShellGet Module
Install-PackageProvider NuGet -Scope CurrentUser -Force
Install-Module PowerShellGet -Scope CurrentUser -Force -AllowClobber
## Remove old modules from existing session
Remove-Module PowerShellGet,PackageManagement -Force -ErrorAction Ignore
## Import updated module
Import-Module PowerShellGet -MinimumVersion 2.0 -Force
Import-PackageProvider PowerShellGet -MinimumVersion 2.0 -Force
<Path> cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.,你必须启用本地脚本运行。## Set globally on device
Set-ExecutionPolicy RemoteSigned
## Or set for just for current PowerShell session.
Set-ExecutionPolicy RemoteSigned -Scope Process
MSAL.PS 的签名证书将改用 Microsoft 的代码签名流程。如果你看到以下错误,PackageManagement\Install-Package : Authenticode issuer 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' of the new module 'MSAL.PS' with version 'x.x.x.x' from root certificate authority 'CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' is not matching with the authenticode issuer 'CN=Jason Thompson, O=Jason Thompson, L=Cincinnati, S=Ohio, C=US' of the previously-installed module 'MSAL.PS' with version 'x.x.x.x' from root certificate authority 'CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US'. If you still want to install or update, use -SkipPublisherCheck parameter.,可以使用以下命令解决该错误。
Install-Module MSAL.PS -SkipPublisherCheck -Force
如果你使用的是 PowerShell Core(即 PowerShell 6 或 7),并且租户要求合规或混合 Azure AD 加入设备的条件访问策略,则可能无法登录。
若要解决此问题,请使用 Windows PowerShell(而不是 PowerShell 6 或 7)。要启动 Windows PowerShell,请转到 开始 > Windows PowerShell
打开 PowerBI 模板时,系统会要求你引用提取数据所在的文件夹(csv 和 json)。选择后,PowerBI 将加载数据。 执行此操作时,PowerBI 可能会报告与数据源交叉引用相关的错误:
Query '*' (step '*') references other queries or steps, so it may not directly access a datasource. Please rebuild this data combination.
若要解决此问题,请配置 PowerBI 文件设置以忽略隐私设置:
本项目欢迎贡献和建议。大多数贡献需要你同意贡献者许可协议(CLA),声明你有权且确实授予我们使用你的贡献的权利。有关详细信息,请访问 https://cla.opensource.microsoft.com。
当你提交拉取请求时,CLA 机器人会自动确定你是否需要提供 CLA,并适当地装饰 PR(例如状态检查、评论)。只需按照机器人提供的说明操作即可。在所有使用我们 CLA 的仓库中,你只需执行此操作一次。
本项目已采用 Microsoft 开源行为准则。 有关详细信息,请参阅行为准则常见问题解答,或通过 [email protected] 联系我们提出任何其他问题或评论。
有关贡献的更详细指导和建议,请参阅贡献页面。
| File/folder | Description |
|---|
build | 用于打包、测试、签名和发布模块的脚本。 |
src | 模块源代码。 |
tests | 模块的测试脚本。 |
.gitignore | 定义提交时要忽略的内容。 |
README.md | 本 README 文件。 |
LICENSE | 模块的许可证。 |