Hi there
I need to run a script that wil show me (by email) the number of current users and inactive users (only the totals)
Here is what I got:
Import-Module Adaxes
$date = Get-Date -format y
$to = email@comp.com
$subject = "User count | " + $date
$Objects_All = Get-AdmUser -Filter * -SearchBase "DC=network,DC=local"
$Objects_All.Count
$Objects_Inactive = Get-AdmUser -Filter {Enabled -eq $False} -SearchBase "DC=network,DC=local"
$Objects_Inactive.count
$bodyText = "Current external user accounts: " + $Objects_All.Count + "r
n" + "Current inactive external user accounts: " + $Objects_Inactive.count
$bodyHtml = $NULL
$Context.SendMail($to, $subject, $bodyText, $bodyHtml)
and this is the body info I want in the emai: (only 1 email)
Current external user accounts:
Current inactive external user accounts:
Please help me as I'm new to this
Thanks
W@lly