Installera .NET 3.5 utan media

dism.exe /online /enable-feature /featurename:NetFX3 /all

Funkar på Windows 2012 R2 och Windows 20016

Om servern är inställd på att använda lokal WSUS2.
Ta bort registry key HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
Starta om Windows update service.
Kör kommandot igen.
När installationen är klar kör gpupdate /force för att lägga tillbaka wsus inställningarna.

Advertisements

MSExchangeTransport event ID 1025

MSExchangeTransport event ID 1025

SMTP rejected a (P1) mail from *** Email address is removed for privacy ***’ with ‘Client Proxy EXCHANGESERVER’ connector and the user authenticated as ‘HealthMailboxf4e9a7dd809f4f8e83c6ffd6364f122b’. The Active Directory lookup for the sender address returned validation errors. Object not found

Leta upp monitoring mailboxarna med:

Get-Mailbox -Monitoring | fl DisplayName,ServerName,EmailAddresses,Database,OrganizationalUnit

Använd ADUC för att kontrollera så att den epostaddress som anges i felmeddelandet finns på den mailboxen. Om den inte finns lägg till den som en proxyadress.

 

OAB generering Exchange.

För att generera nya OAB varannan timme Exchange 2013:

Get-MailboxServer | Set-MailboxServer -OABGeneratorWorkCycle 00.02:00:00 -OABGeneratorWorkCycleCheckpoint 00:30:00

För att generera nya OAB varannan timme Exchange 2016 CU4 och senare:

New-SettingOverride -Name "OAB Generation Override" -Component TimeBasedAssistants -Section OABGeneratorAssistant -Parameters @("WorkCycle=02:00:00") -Reason "Generate OAB every 2 hours"

För att applicera Exchange 2016:

Get-ExchangeDiagnosticInfo -Process Microsoft.Exchange.Directory.TopologyService -Component VariantConfiguration -Argument Refresh

För att kontrollera Exchange 2016 CU4 och senare:

[xml]$diag=Get-ExchangeDiagnosticInfo -Server <ServerName> -Process MSExchangeMailboxAssistants -Component VariantConfiguration -Argument "Config,Component=TimeBasedAssistants"; $diag.Diagnostics.Components.VariantConfiguration.Configuration.TimeBasedAssistants.OABGeneratorAssistant

För att kolla Event (Applicationlog)
17001 Start
17002 Klar

Script för att ta bort gamla moverequests

Script to remove old moverequests
————————————
Error 1121
The Microsoft Exchange Mailbox Replication service was unable to process a request due to an unexpected error.
Request GUID: ‘7ff5aee6-4459-4d75-b1a7-8effa424add9’
Database GUID: ‘0acdce99-aab5-4c88-99a6-25e68995e9c6′
Error: Database ’15f21f3e-dbb8-405f-a1ec-c4b50dc87da9’ doesn’t exist..
—————————————-
# USE Below to get a CSV file
# Get-MoveRequestStatistics -MoveRequestQueue 0acdce99-aab5-4c88-99a6-25e68995e9c6 | select Displayname, exchangeguid, requestguid | Export-Csv move-req.csv -encoding utf8 -notypeinformation
***Script*******
param ([string] $CSVPath)

# Add Requestqueuename This id the Database GUID from the errormessage.
$RequestQueue = “0acdce99-aab5-4c88-99a6-25e68995e9c6”

$Moverequests = $CSVUsers= (Import-CSV -delimiter “,” $CSVPath)

Foreach ($Moverequest in $Moverequests)
{
remove-moverequest -moverequestqueue $RequestQueue -mailboxguid $Moverequest.ExchangeGuid
}”

Script loginhistorik användare (aktuell säkerhetslogg).

Script för att söka genom säkerhetsloggar efter EventID 4624 och en specifik användare.
Skriver ut resultat till skärm och CSV fil.
Kör lokalt om möjlighet finns (remote tar lååång tid..)
#--------------------------------------------------------
# Script to view loginhistory for a user (Eventid 4624)
# Parameters get-logon -username -computer
#
#-------------------------------------------------------

param (
[string]$Computer = $env:COMPUTERNAME,
[Parameter(Mandatory=$true)][string]$username
)
#Variables
$Scriptpath = Split-Path -Parent $MyInvocation.MyCommand.Path
$Logdate = get-date -format "yyMMdd-hhmmss"
$csvfile = "$scriptpath\Login $username $computer $Logdate.log"
$ErrorActionPreference = "Stop"

# Get Events from Securitylogs with ID 4624 and $username..
# Break if RPC error

Write-Host "Gathering Events, this can take awhile..." -ForegroundColor Green
Try
{
$Events = Get-winevent -computer $Computer -FilterHashtable @{logname='Security';ID="4624"} | where {$_.message -match "Account Name:\s*$username"}
}
catch [System.Diagnostics.Eventing.Reader.EventLogException]
{
write-host "The RPC server on $computer is not available, check firewallsettings" -ForegroundColor Red
break
}

# Parse out the event message data
ForEach ($Event in $Events) {
# Convert the event to XML
$eventXML = [xml]$Event.ToXml()
# Iterate through each one of the XML message properties
For ($i=0; $i -lt $eventXML.Event.EventData.Data.Count; $i++) {
# Append these as object properties
Add-Member -InputObject $Event -MemberType NoteProperty -Force -Name $eventXML.Event.EventData.Data[$i].name -Value $eventXML.Event.EventData.Data[$i].'#text'
}
}

# Write output
$Events | select @{ name = "Computer" ; Expression = {$_.MachineName}}, @{ Name = "Logontime" ; expression = {$_.TimeCreated }},targetdomainname,targetusername,@{ Name= "LogonFromIP" ; Expression = { $_.ipaddress}} | Out-GridView
$Events | select @{ name = "Computer" ; Expression = {$_.MachineName}}, @{ Name = "Logontime" ; expression = {$_.TimeCreated }},targetdomainname,targetusername,@{ Name= "LogonFromIP" ; Expression = { $_.ipaddress}} | Export-Csv -NoTypeInformation -Encoding UTF8 $csvfile