Allgemein

Get Exchange mailboxes of disabled Active Directory accounts with PowerShell

Today a one liner: I needed a list of Exchange mailboxes with disabled Active Directory accounts. Here is the command to display them in the PowerShell window: Get-Mailbox | where {$_.ExchangeUserAccountControl -Match "AccountDisabled"} | fl DisplayName, Database, ExchangeUserAccountControl If you want to create a csv file that lists all OWA enabled users but excludes all disabled accounts use the following command line (using Get-CASMailbox together with Get-Mailbox): Get-Mailbox | where {$_.ExchangeUserAccountControl -ne "AccountDisabled"} | Get-CASMailbox | where {$_.OwaEnabled -eq "True"} | Select DisplayName, OwaEnabled | Export-Csv -Path ("{0}\Desktop\OWA.Users.csv" -f $env:USERPROFILE) -NoClobber -Encoding UTF8 -NoTypeInformation This will create the list and...
Allgemein

Change the Windows updates install time on Hyper-V Server

I needed to change the install time of Windows updates on a Hyper-V Server 2016 from the default of 03:00 to 01:00. There is an Option in sconfig (the blue menu box) to change the Windows update install behavior from manual to automatic but there is no option to change the time when the installation of the updates should happen so it defaults to 3:00 AM. It is also not possible to install the Windows update Cmdlets that would allow us to change the configuration of the Windows updates because that feature does not exist in Hyper-V Server. So the...