Skip to content

Commit 28ffadc

Browse files
authored
FIXED: NULL default computers table
1 parent 5ef1a60 commit 28ffadc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

PSHTML-AD.ps1

+9
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,15 @@ foreach ($DefaultUser in $DefaultUsers)
399399
$DefaultUsersinDefaultOUTable.Add($obj)
400400
}
401401

402+
if (($DefaultUsersinDefaultOUTable).Count -eq 0)
403+
{
404+
405+
$DefaultUsersinDefaultOUTable = [PSCustomObject]@{
406+
407+
Information = 'Information: No Computers were found in the Default OU'
408+
}
409+
}
410+
402411
#Expiring Accounts
403412
$LooseUsers = Search-ADAccount -AccountExpiring -UsersOnly
404413

0 commit comments

Comments
 (0)