Get-MsolUser过滤变量 [英] Get-MsolUser filtered variable
问题描述
想知道是否有人可以提供帮助...
Wonder if anyone can help...
>我有一个包含用户主要名称列表的txt文件。
> I have a txt file containing a list of user principal names.
>如果他们拥有许可证并且他们的UPN未列在TXT文件中,我需要返回所有用户。
> I need to return all users if they have a licence and their UPN isn't listed in the TXT file.
#User Import#
$ Users = Get-Content C:\Users\NAME\UserImport.txt
#User Import#
$Users = Get-Content C:\Users\NAME\UserImport.txt
#获取所有许可用户&过滤了
foreach($ MSOLUsers中的用户){
$ User = Get-MsolUser -UserPrincipalName $ MSOLUser
$ users = Get-MsolUser -All | Where-Object {$ _。isLicensed -eq $ true -and $ _.UserPrincipalName-notlike" * $ Users *"}
$ users.Count
}
#Get All Licensed Users & Filtered
foreach ($Users in $MSOLUsers){
$User = Get-MsolUser -UserPrincipalName $MSOLUser
$users = Get-MsolUser -All | Where-Object {$_.isLicensed -eq $true -and $_.UserPrincipalName -notlike "*$Users*"}
$users.Count
}
任何帮助表示感谢!
Any help appreciated!
Callum
推荐答案
您好Callum,为了尽可能回答您的问题,请发布您的问题
here 。
Hi Callum, to get the best possible response to your question, please post your question here.
这篇关于Get-MsolUser过滤变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!