Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Powershell scripts to log lock and unlock computer for the user

Posted on 2016-08-22
4
Medium Priority
?
414 Views
Last Modified: 2016-08-29
Hi All,

I just want a powershell scripts to log lock and unlock computer for the user.
This script is going to be deployed through AppSense.
0
Comment
Question by:Techie solution
  • 2
4 Comments
 
LVL 84

Assisted Solution

by:David Johnson, CD, MVP
David Johnson, CD, MVP earned 1000 total points
ID: 41766100
you have to monitor the security event log on the machine for the id:4800 Lock and ID:4801 Unlock
Computer Configuration / Windows Settings / Security Settings / Advanced Audit Policy Configuration / System Audit Policies - Local Group Policy Object / Logon/Logoff / Audit Other Logon/Logoff Events
0
 
LVL 9

Accepted Solution

by:
James Rankin earned 1000 total points
ID: 41766115
If you're using AppSense no need for a script. Appsense has Locked and Unlocked triggers. Just add actions on these triggers to do whatever you want - you could easily use the Update Text File action to write to a log.
0
 
LVL 9

Expert Comment

by:James Rankin
ID: 41766116
If you're using AppSense no need for a script. Appsense has Locked and Unlocked triggers. Just add actions on these triggers to do whatever you want - you could easily use the Update Text File action to write to a log.
0
 

Author Closing Comment

by:Techie solution
ID: 41775481
Thank you both
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/receā€¦
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question