我不明白为什么这不起作用 [英] I can't see why this isn't working

查看:67
本文介绍了我不明白为什么这不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,

所以我有这个脚本,我希望能检查一个小组,看看是否有某些计算机的列表在那里

So I've got this script which I was hoping would check a group to see if a list of certain computers were in there

$mycomp=get-content "C:\temp\computers.txt"

Get-ADComputer "$mycomp" -Properties MemberOf | %{if ($_.MemberOf -like "Apps_Autodesk_DWGTrueView2014_S") {Write-Host "found"} }

我所拥有的是一长串计算机,我想检查该组。任何想法为什么它不工作,我得到以下错误

All I have is a long list of computers I want to check against the group. Any idea why it's not working, I get the following error

推荐答案

使用此:

Get-ADComputer  -Property * | 
Where-Object {


_.memberof -match" Apps_Autodesk_DWGTrueView2014_S"}
_.memberof -match "Apps_Autodesk_DWGTrueView2014_S"}


这篇关于我不明白为什么这不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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