Disable UAC for administrator using Powershell

Commandline configurations are my favorited. They are very usefull to be used in standard Configuration scripts. This evening I stumbled across this one and wanted to share it. The command uses the registry to perform the change. This allows also other configurations to be injected. My life just got a little bit easier once again…

Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 1

PowerShell script reboot check

Today, I received a mail notification that a given server is not available anymore. The error was sent around 6:10 in the morning. The server is a management server not managed by our team.

To decrease the time required if the reboot was caused by Windows updates (which was the reason in the past), I quickly wrote a little PowerShell script to determine the cause.

PS C:\Users\rur> Get-EventLog -LogName System -after (get-date).addhours(-48) | where {($_.EventId -eq 1074) -or ($_.EventId -eq 22)} | select TimeGenerated,EventId,Message | format-table -wrap -autosize

Continue reading