Syntax
$taskName = “4741-comp-noti”
$taskRunAsuser=”Domainname\Administrator”
$taskRunasUserPwd = “Domain Administrator password”
$Path = ‘PowerShell.exe’
$Arguments = “C:\Users\Administrator\Documents\4741.ps1”
$Service = new-object -ComObject (“Schedule.Service”)
$Service.Connect()
$RootFolder = $Service.GetFolder(“\Event Viewer Tasks”)
$TaskDefinition = $Service.NewTask(0)
Download Full Script
EventID: 4741
Source: Microsoft-Windows-Security-Auditing
MachineName:
Message: A computer account was created.
Subject:
Security ID:
Account Name:
Account Domain:
Logon ID:
New Computer Account:
Security ID:
Account Name:
Account Domain:
Purpose: | By running this script you'll get an email notification everytime a user account gets created in the domain |
Modification: | Add SMTP, Email ID |
Type: | PowerShell (.ps1) |
Compatibility: | Run with PowerShell |
Tags: | Notification, E-mail, New Device, New Computer account |
Reference link: |