我有2个域,我将几天内处于非活动状态的ADuser接收,并将两个ADuser都存储在2个不同的数组中并进行比较。 但是我无法比较两个数组,有人可以帮助我吗。
$obj =@()
$obj = Get-ADUser -Filter {LastLogonTimeStamp -lt $time -and enabled -eq
$true} -Properties LastLogonTimeStamp -SearchBase "OU=active,DC=adtest,DC=com" |
Where-Object { $_.DistinguishedName -notlike '*OU=Disabled,*' } | select-object ObjectGUID,Name
$obj1 = @()
$obj1 = Get-ADUser -Filter {LastLogonTimeStamp -lt $time -and enabled -eq $true} -Properties LastLogonTimeStamp -SearchBase "OU=active,DC=adxyz,*' } |
select-object ObjectGUID,Name
$obj | ForEach-Object {
if ($i -in $obj.ObjectGUID -eq $j -in $obj1.ObjectsGUID) {
}
}
我应该具有与输出相同的objectGUID。