Skip to main content

Posts

Showing posts from May, 2021

Manage Exchange Mailbox rules with Powershell

  Get All rules for a mailbox       Get-InboxRule -Mailbox mailbox Gives something like  Name                  Enabled Priority RuleIdentity ----                  ------- -------- ------------ Forward mail to Yahoo True    1        nnnnnnnnnnnnnnnnnnnnn Select all rule properties  Get-InboxRule -Mailbox mailbox -Identity nnnnnnnnnnnnnnnnnnnnnnn

Creating a Developer Certificate for IIS, and having it trusted by the computer, not just you.

  There's a few different ways to do this, but for me, with a Blazor Server application and backend API, this seemed to work the best.  Step 1 - Create Certificate  I got this script from  Develop Locally with HTTPS, Self-Signed Certificates and ASP.NET Core (humankode.com) It's fairly well documented, but there's a few things to note:  - Change Subject and Dnsname to your preferred name  - Note the certifcate store location, in your personal store - Note the hard coded password  YourSecurePassword - I don't know what the TextExtension field does, need to research that - Note that the created cer file is deleted at the last step   However, this process didn't get me in a position where the server itself trusted the certificate, which is what I needed for Blazor, see Step 2 below. # setup certificate properties including the commonName (DNSName) property for Chrome 58+ $certificate = New - SelfSignedCertificate ` - Subject localhost ` - DnsName localhost `

WIndows Update on Server 2019

Having problems with Windows Update on a Windows Server 2016 on AWS Lightsail.  AWS turn off Windows Update by default, and there is some other tool AWS uses to process update, however I don't think it manages LightSail machines.  I made some changes to the group policy, and that seems to have started Windows Updates, but they don't seem to be installable on demand.  I found this at  https://docs.microsoft.com/en-us/answers/questions/356003/windows-10-updates-kb2267602-security-intelligence.html Run Windows update troubleshooter firstly, this tool can diagnose and repair update issue automatically. Then, restart computer and check for updates again. If still no help, reset Windows update component manually: Open an elevated command prompt windows, type the following commands one after the other, and hit Enter: net stop wuauserv net stop bits rename c:\windows\SoftwareDistribution SoftwareDistribution.bak net start wuauserv net start bits Open an elevated Command Prompt, type th

Using Let's Encrypt with OpenVPN

Basically follow the instructions to install certbot for ubuntu from  Certbot (eff.org) Note that it uses snap to install certbot , not some bespoke apt repo There's only 2 things you need to worry about, because snapd is already installed at part of openvpn / ubuntu:   Install Certbot sudo snap install --classic certbot Create a symbolic link sudo ln -s /snap/bin/ certbot / usr /bin/ certbot This is where we can depart the normal process, and create the lets encrypt certs. run the following command and follow the prompts sudo certbot certonly --standalone --preferred-challenges http -d vpnserver.yourdomain.com Finally install the certificates in the website, using the web interface    Automation .    I haven't tried this myself, but you should be able to automate this by creating a file with the   following  ( remember to chmod it with +x) #!/ bin/bash certbot renew — standalone sleep 1m / usr /local/ o

Changing Password - in AD, when you're changing one of your other accounts, not the logged in account

  Use Powershell  Step 1 - Put your existing password in a Secure String  $oldPassword = Read-Host "Your old Password" -AsSecureString  Step 2 - Start the password change set-AdAccountPassword -Identity paul-admin -OldPassword  $oldPassword Step 3 - Enter your new password You'll be prompted for your new password... Please enter the desired password for 'CN=xxxx,OU=Admin Users,OU=Users,OU=Privileged,DC=CAIS,DC=com,DC=edu,DC=au' Password: ************************** Repeat Password: **************************

Find Exchange Mailbox with a certain alias

 Today I was asked to find the mailbox that held a certain alias, or additional email address The Exchange Admin Web client wasn't very helpful, but LDAP was with the following query... searcher.Filter = $"(proxyaddresses=smtp:sales@company.com)"; The trick with the ldap query was I needed to include the smtp: prefix.  In the end, it wasn't a mailbox or sharedbox, but rather a distribution list, and LDAP didn't care.