Create a Monthly report using schedule task using PowerShell script
#Would talk about pre-requisites for importing ActiveDirectory Module at end of post import-module ActiveDirectory #Preparing files to write data and attach to email $file1 = "D:\Bixam\AD_Enabled_Users\Arcosa_Enabled_Users_list_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv" Get-ADUser -filter "enabled -eq'true'" -Properties * | Select-object @{N="AD Emplid"; E={$_.employeeid}},@{N="AD Emplnum"; E={$_.employeenumber}},@{N="Employee Name"; E={$_.displayNameprintable}},@{N="Segment"; E={$_.extensionattribute6}},@{N="Company"; E={$_.extensionattribute2+"-"+$_.extensionattribute3}},@{N="Business Unit"; E={$_.company}},@{N="EE Type"; E={$_.employeetype}},@{N="Country"; E={$_.co}},@{N="Email Address"; E={$_.mail}},@{N="AD Network ID"; E={$_.samaccountName}} | export-csv "$file1" -NoTypeInformation #Email related settings $smtpServer ...