This is part 2 of a two-part Script. The email ID you mention will get an email every time a new device (a new computer account) gets added to the domain.
$taskName = “4741-comp-noti”
$taskRunasUserPwd = “Domain Administrator password”
$Path = ‘PowerShell.exe’
$Arguments = “C:\Users\Administrator\Documents\4741.ps1”
$Service = new-object -ComObject (“Schedule.Service”)
$RootFolder = $Service.GetFolder(“\Event Viewer Tasks”)
$TaskDefinition = $Service.NewTask(0)
Message: A computer account was created.
New Computer Account:
|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|
|Compatibility:||Run with PowerShell|
|Tags:||Notification, E-mail, New Device, New Computer account|