This what I thought was working until I checked in outlook.
Import-Module ActiveDirectory $AllUsers = get-aduser -filter { objectClass -eq "User" -and Enabled -eq "True"} -Properties SamAccountName | select SamAccountName $WithPhotos = get-aduser -filter { objectClass -eq "User" -and Enabled -eq "True" -and thumbnailPhoto -ne "NULL" } -Properties SamAccountName | select SamAccountName $WithoutPhotos = Compare-Object -ReferenceObject $WithPhotos -DifferenceObject $AllUsers -PassThru
submitted by /u/no_skillz
[link] [comments]
The post Check if AD users have a thumbnailPhoto appeared first on How to Code .NET.