Forum Discussion
Skipster311-1
Dec 01, 2021Iron Contributor
Detect old devices
Hello
I am running the below script to detect devices that are older than 60 days. What i dont understand is how can a device show as "Dirsyncenabled" = FALSE, but is found in the metaverse on the azure ad connect server ?
#list all stale devices
$dt = [datetime]'2021/10/01'
get-azureaddevice -all $true | where {$_.ApproximateLastLogonTimeStamp -le $dt} | select `
objectid, deviceid, DisplayName,AccountEnabled,ApproximateLastLogonTimeStamp,DeviceOSType,DeviceOSVersion, `
DeviceTrustType,DirSyncEnabled,LastDirSyncTime,ProfileType | export-csv .\aad_device_stale.csv -NoTypeInformation
No RepliesBe the first to reply