Tuesday, October 18, 2016

Verify you Windows Server Backups with notification

If you scheduled a Windows Server Backup, you can check for Errors and send an email if a Error happened.

To do this just schedule to run the following script after your backup job:

# Check EventLog for Error created by Windows Backup
If (Get-EventLog -LogName Application -EntryType Error -Source Microsoft-Windows-Backup -After (Get-Date).AddHours(-24))
    #Set E-mail variables.
    $EmailFrom = "server@yourdomain.com"
    $EmailTo = "Tim.Buntrock@yourdomain.com"
    $Subject = "$env:COMPUTERNAME - Windows Backup failed"
    $Body = "$env:COMPUTERNAME - Windows Backup failed. Please logon to the server and verify your backup task!"
    $SMTPServer = "smtp01.yourdomain.com"
    #Send message
    Send-MailMessage -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Priority High -To $EmailTo -From $EmailFrom


Thats it. :)

AD Powershell Oneliner - Get PSO Settings

Just type in the following:
Get-ADFineGrainedPasswordPolicy PSOName
Replace PSOName with the name of your PSO object.

You can add >c:\admin\PSOSettings.txt to export the settings to a text file.
Get-ADFineGrainedPasswordPolicy PSOName >c:\admin\PSOSettings.txt

Tuesday, September 27, 2016

DCDIAG MachinAccount test Warning: Attribute userAccountControl of DC is: 0x82020

You are running a DCDiag and its shown a warning by performing the MachineAccount test.

If you are pre-stage a Computer account in ADUC and you promote it later, the userAccountControl is set to 532512 instead of the 532480.

To fix this Bug, open ADSI edit, connect to default naming context and browse to the DC that is affected. Open Properties and go to userAccountControl and click on Edit.



You need to manually set the vaulue to 532480.


After that its set to the standard DC value!