We are attempting to run a powershell script if a user in a specific AD group logs into a machine. The script will grab the current user ID and SID and adjust some registry settings for a migration. We can run the script if the user is already logged in but not if a user logs in after the task assignment. I added a Start-Sleep -Seconds 120 in the script thinking that it would help but it still will not grab the SAMAccountName .
Thx