RedPlug's Tory

 

 

 

$When = ((Get-Date).AddDays(-0)).Date
$Date = Get-Date -UFormat "%Y/%m/%d"
$Csvfile = Get-ADUser -Filter {whenCreated -ge $When} -Properties * | Select @{Name = "계정"; Expression = {$_.CN}},@{Name = "부서"; Expression = {$_.Department}},@{Name = "이름"; Expression = {$_.DisplayName}},mail,@{Name = "내선번호"; Expression = {$_.IPPhone}},description,@{Name = "Lync"; Expression = {$_.'msRTCSIP-PrimaryUserAddress'}},@{Name = "사번"; Expression = {$_.extensionAttribute3}} | ConvertTo-Html | Out-string
$file = "c:\csv\userexport.csv"
$SendMail = "test@redplug.kr"
$ReciveMail = "redplug@redplug.kr"
$SMTPServer = "smtp.redplug.kr"

 

Send-MailMessage -From $SendMail -to $ReciveMail -subject "$Date 자 계정 생성 리스트" -SmtpServer $SMTPServer -Body "$Csvfile" -BodyAsHtml -Encoding UTF8