E-mail notification when new user gets added (Script 2) – PowerShell Script

This is part 2 of a two-part Script. The email ID you mention will get an email every time a new user gets added to the domain.


$taskName = “4720-user-noti”
$taskRunasUserPwd = “Domain Administrator password”
$Path = ‘PowerShell.exe’
$Arguments = “C:\Users\Administrator\Documents\4720.ps1”

$Service = new-object -ComObject (“Schedule.Service”)
$RootFolder = $Service.GetFolder(“\Event Viewer Tasks”)
$TaskDefinition = $Service.NewTask(0)

Download Full Script

EventID: 4720
Message: A computer account was created.

Security ID:
Account Name:
Account Domain:
Logon ID:

New Account:
Security ID:
Account Name:
Account Domain:

Attributes & Additional Information

Share Script:

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 user
Reference link: