PowerShell:从Azuread迁移到AZ模块 - 但找不到Get -azureadusermbership的替代品

发布于 2025-02-13 11:10:01 字数 275 浏览 0 评论 0原文

我遇到了一个奇怪的问题 - 因为我在找到 az 的模块时遇到了麻烦, azuread cmdlet get -azureadusermembership

当似乎不存在 get-azadusermemhip get-azadusermemhip azadusermemhip azadusermemhip

问候,粘性

I'm having a strange issue - as I'm having trouble with locating the Az module pendent to the AzureAD cmdlet Get-AzureADUserMembership.

How do I retrieve a list off groups for a particular user, when Get-AzADUserMembership does not seem to exist?

Regards, Stickybit

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盛夏已如深秋| 2025-02-20 11:10:01

我找不到AZMODULE中Get-azureadusermership的等效

$groups=Get-AzADGroup 
#$members=Get-AzADGroupMember -GroupDisplayName $name  
$memberobj="<give the user object id here for which you need to find groups>"  

foreach($group in $groups)  
{  
$members= Get-AzureADGroupMember -ObjectId $group.ObjectId -All $true

foreach($member in $members)  
{  

if($member.ObjectId -eq $memberobj)  
{  
Write-output $group.DisplayName
}  
}
}


“在此处输入图像描述”

在预览过程中,您不能在生产方面使用。
Microsoft支持团队有关详细信息。

在少数情况下,Microsoft Graph API的行为差异将引起破坏变化。

参考:
Azure AD到Microsoft Graph迁移,用于Azure命令行工具。 - Microsoft Tech社区

I couldn't find equivalent for Get-AzureADUserMembership in Azmodule but when i tried with the below commands:

$groups=Get-AzADGroup 
#$members=Get-AzADGroupMember -GroupDisplayName $name  
$memberobj="<give the user object id here for which you need to find groups>"  

foreach($group in $groups)  
{  
$members= Get-AzureADGroupMember -ObjectId $group.ObjectId -All $true

foreach($member in $members)  
{  

if($member.ObjectId -eq $memberobj)  
{  
Write-output $group.DisplayName
}  
}
}

Output:
enter image description here

It is in under preview process you cannot use in production side.
Reach out to the microsoft support team for detailed information.

In few cases, the behavioral difference of the Microsoft Graph API from the AzureAD Graph API will induce a breaking change.

Reference:
Azure AD to Microsoft Graph migration for Azure command line tools. - Microsoft Tech Community

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文