[2024-05-10 22:15:03.7951][1][Information]: UnifiedExportTool engine version: 15.20.1771.000, CLR version: 4.0.30319.42000.
[2024-05-10 22:15:03.7961][1][Information]: Current local time: 11.05.2024 03:15:03, current UTC time: 10.05.2024 22:15:03.
[2024-05-10 22:15:03.7961][1][Information]: OS version: Microsoft Windows NT 6.2.9200.0, processor count: 20, x64: True, working set: 31125504.
[2024-05-10 22:15:03.7961][1][Information]: Export name: a.bissengaliyeva@norsec.kz PST.
[2024-05-10 22:15:03.7976][1][Information]: ConstantProvider..Ctor: Registry not found for constants
[2024-05-10 22:15:03.8545][5][Information]: Start progress controller loop.
[2024-05-10 22:15:03.9045][1][Information]: Effective downloader concurrency: 48
[2024-05-10 22:15:03.9065][5][Information]: Start result recorder loop.
[2024-05-10 22:15:04.7046][1][Error]: Fatal error happened. Microsoft.WindowsAzure.Storage.StorageException: Удаленный сервер возвратил ошибку: (404) Не найден. ---> System.Net.WebException: Удаленный сервер возвратил ошибку: (404) Не найден.
в Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)
в Microsoft.WindowsAzure.Storage.Blob.CloudBlobSharedImpl.<>c__DisplayClassa.<FetchAttributesImpl>b__9(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)
в Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)
--- Конец трассировки внутреннего стека исключений ---
в Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End()
в Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.EndOpenRead(IAsyncResult asyncResult)
в Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass1`1.<CreateCallback>b__0(IAsyncResult ar)
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
в Microsoft.Office.Compliance.Core.DiscoveryStore.DiscoveryStoreReader.<GetMetadataAsync>d__15.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
в Microsoft.Office.Client.Discovery.UnifiedExport.Utils.ServerKnowledge.ServerExportJobTracker.<GetStoreMetadataAsync>d__6.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
в Microsoft.Office.Client.Discovery.UnifiedExport.Engine.Lite.LiteExportEngine.<ServerJobMonitorLoop>d__7.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
в Microsoft.Office.Client.Discovery.UnifiedExport.Engine.Lite.LiteExportEngine.<Execute>d__4.MoveNext()
Request Information
RequestID:3068c791-e01e-0032-6d27-a3b240000000
RequestDate:Fri, 10 May 2024 22:15:04 GMT
StatusMessage:The specified resource does not exist.
[2024-05-10 22:15:04.7096][1][Information]: Start to cancel the export.
# SMTP server parameters
$smtpUsername = "test@domain"
$smtpPassword = "Password#"
$smtpServer = "domain.mail.protection.outlook.com"
$smtpPort = 25
$smtpFrom = "test@domain"
$smtpTo = "user@domain"
$smtpSubject = "New User Created in Active Directory"
# Function to send email
function Send-Mail($message) {
try {
# Convert password to a secure string
$securePassword = ConvertTo-SecureString -String $smtpPassword -AsPlainText -Force
# Create email credentials
$smtpCredentials = New-Object System.Management.Automation.PSCredential -ArgumentList $smtpUsername, $securePassword
# Send email using Exchange Online
Send-MailMessage -From $smtpFrom -To $smtpTo -Subject $smtpSubject -Body $message -SmtpServer $smtpServer -Port $smtpPort -UseSsl -Credential $smtpCredentials
} catch {
Write-Host "Error sending message: $_"
}
}
$lastCheckFile = "C:\scripts\lastCheck.txt"
$lastCheck = if (Test-Path $lastCheckFile) { Get-Content $lastCheckFile } else { (Get-Date).AddDays(-1) }
Import-Module ActiveDirectory
$users = Get-ADUser -Filter * -Properties whenCreated, DisplayName, EmailAddress
foreach ($user in $users) {
if ($user.whenCreated -gt $lastCheck) {
$message = "User $($user.SamAccountName) has been created in Active Directory." +
"`nDisplay Name: $($user.DisplayName)" +
"`nEmail: $($user.EmailAddress)" +
"`nCreation Date: $($user.whenCreated)" +
"`nDomain: $($user.DistinguishedName)"
Write-Host "Sending notification for user: $($user.SamAccountName)"
Send-Mail $message
}
}
Set-Content -Path $lastCheckFile -Value (Get-Date)
Может кому-нибудь будет полезным: