Hi,
You can use the following script to move all users logged in past 7 days to a target OU:
Import-Module ActiveDirectory
#Number of Days to check back.
$NumberDays=7
#Organizational Unit to search
$targetOU='OU=Users,OU=Camtac,OU=Canada,DC=linamar,DC=com'
#Move user to target OU
GET-ADUSER -filter * -properties LastLogonDate | where { $_.LastLogonDate.AddDays($NumberDays) -lt $CurrentDate } | move-ADobject -TargetPath $targetOU
Don't forget to mark this reply as answer if it help you to fix your issue