Get-MsolUser过滤变量 [英] Get-MsolUser filtered variable

查看:76
本文介绍了Get-MsolUser过滤变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


想知道是否有人可以提供帮助...

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆