My Mobile phone Bluetooth is paired with my Laptop. I am trying to write a power shell script which can catch an event if I move out of Bluetooth range. Any leads on this idea?
You are talking using a WMI event to monitor event logs for event ID's
So, you are going to have to research to find out what the event ID is and the log where it will show up and have your WMI log watcher fire off some alert.
Just curious. Why is this a thing for you?
I mean, you'll know when you are out of range with the connection drops / stops working. Why go the extra step of have PoSH send you a notification about something you'll already know has happened.
WMI Event Watcher Task'docs.microsoft.com/en-us/sql/integration-services/control-flow/wmi-event-watcher-task'
Attaching scripts or tasks to Windows event log entries using PowerShell and WMI'ravichaganti.com/blog/attaching-scripts-or-tasks-to-windows-event-log-entries-using-powershell-and-wmi'
PowerShell EventLogWatcher Module'archive.codeplex.com/?p=pseventlogwatcher'
@postanote My idea is if the paired Bluetooth device goes out of range then my script will capture it and lock down the users system. I am just trying to avoid this manual activity. Dynamic lock feature of Win-10 I have explored but it’s not quite reliable. If you can suggest any good approach to accomplish this, please let me know.
Or just another idea, can I capture the last detection time of my device ? So that I shall compare this with my system time and decide whether it’s out of range.