Powershell: Export users from AD to Excel

Export all users from AD from a specific OU (recursive) to Excel

Get-ADUser -Filter * -SearchBase $OU -SearchScope Subtree | Select-object DistinguishedName,Name,UserPrincipalName | export-csv -path c:\temp\userexport.csv

Only enabled users

Get-ADUser -Filter * -SearchBase $OU -SearchScope Subtree | Select-object DistinguishedName,Name,UserPrincipalName,Enabled | Where {$_.Enabled -like "False"} | export-csv -path c:\temp\userexport.csv 

Basic Ruckus switch configuration

In this example, we are going to configure a Ruckus ICX 7150-24.

  1. Connect your computer to the switch with the console port
  1. Open Device Manager to look up the COM port number
  1. Open Putty and connect to the assigned COM port
  1. Login with the default username and password (super / sp-admin) and change the default password
  1. Configure the switch with default configuration
conf t
ip address
ip default-gateway
ip dns server-address
hostname SW1
cdp run
lldp run
no web-management http
web-management https
no telnet server
enable super-user-password <password>
username icxadmin password <password>
aaa authent login default local
aaa authentic web-server default local
clock timezone europe cet
  1. Save the configuration
wr mem
  1. Reboot the switch

Expand virtual disk of Azure SQL Virtual Machine

Expand a virtual disk of Azure SQL Virtual Machine in the Azure Portal.

Expanding of the disk can be done online.

  1. Go to the Azure Portal
  2. Search for “SQL virtual machines”
  1. Select your SQL virtual machine
  2. In the menu, select “Storage Configuration”
  1. Configure the data disk you want to expand
  1. Select the disk of the size where you want to expand the existing disk with
    • For example 1, your disk is currently 128Gib and you want to extend it to 256Gib, choose the 128Gib disk
    • For example 2, you disk is currently 256Gib and you want to extend it to 768Gib, choose the 512Gib disk
  1. That’s is, you don’t have to do anything in the OS

Offboard device from Microsoft Defender for Endpoint

Offboard device from Microsoft Defender for Endpoint using Mobile Device Management tools

  1. Get the offboarding packet from Microsoft 365 Defender portal
    1. Navigate to Settings => Endpoints => Device management => Offboarding
security microsoft
  1. Extract the script on the client
windows defender offboarding script
  1. Run the script as administrator


Offboard devices from the Microsoft Defender for Endpoint service | Microsoft Learn

Onboard Windows devices to Defender for Endpoint using Intune | Microsoft Learn

Configure Cisco AnyConnect with SAML (Azure)

Configure Cisco AnyConnect on Cisco Meraki MX firewall with SAML authentication from Azure


  1. Log in to Azure Portal and select Azure Active Directoryazureportal
  2. Select “Enterprise Applications”
    enterprise applications
  3. New Application
  4. In the Add from the gallery section, type AnyConnect in the search box, select Cisco AnyConnect from the results panel, and then add the app. 
  5. Single Sign On
  6. SAML
  7. Edit Section 1
    1. Identifier (Entity ID)  – 
    2. Reply URL (Assertion Consumer Service URL) –
  8. SAML Signing Certificate, Download Federation Metadata XML filecode


  1. Go to your Network
  2. Select “Security & SD-WAN” => Configure => Client VPN
  3. Second tab “AnyConnect Settings”
    1. Enabled
    2. Leave the default AnyConnect Port to 443
    3. Authentication Type => SAMLsaml
    4. AnnyConnect Server URL, same as the hostname but with “https://”annyconnectserverurl
    5. Upload the Federation Metadata XML file from step 8 in the previous sectionsdf


  1. Choose left in the menu for “Users and groups” => Add usersdf
  2. Select “Users and groups”
  3. Assign


AnyConnect Authentication Methods – Cisco Meraki

AnyConnect Azure AD SAML Configuration – Cisco Meraki

Exchange Online: Upgrade DKIM keys to 2048-bit

Manuallly upgrade existing DKIM keys from 1024-bit to 2048-bit

Connect to Exchange online using powershell

Import-Module ExchangeOnlineManagement

Upgrade key to 2048-bit

Rotate-DkimSigningConfig -KeySize 2048 -Identity {domain name}


Rotate-DkimSigningConfig -KeySize 2048 -Identity


Get-DkimSigningConfig -identity | Select Selector1KeySize

This new 2048-bit key takes effect on the RotateOnDate, and will send emails with the 1024-bit key in the interim. After four days, you can test again with the 2048-bit key (that is, once the rotation takes effect to the second selector).

Get-DkimSigningConfig -identity | Select RotateOnDate


Connect to Exchange Online PowerShell | Microsoft Learn