MapiADTools

1.0.2

MapiADTools is a collection of 14 advanced commandlets for Windows and Active Directory administration. It focuses on system diagnostics, client lifecycle management, and rapid inventory. The functions combine high-speed parallel processing with deep-dive analysis (WMI/CIM, Registry, AD attributes) to provide accurate, definitive answers to common administrative chall
MapiADTools is a collection of 14 advanced commandlets for Windows and Active Directory administration. It focuses on system diagnostics, client lifecycle management, and rapid inventory. The functions combine high-speed parallel processing with deep-dive analysis (WMI/CIM, Registry, AD attributes) to provide accurate, definitive answers to common administrative challenges.

--- Available Functions ---

[ AD & User Management ]
- Get-ADUserInfo (gadu): Flexible user search (name parts, SAM), retrieves password expiry, accurate last logon (by querying all DCs), and last-used PC from MECM exports.
- Set-ADUserMustChangePassword: Correctly enables, disables, or toggles the "User must change password at next logon" requirement.
- Test-ADUserMailboxMigrationStatus: Checks a user’s Exchange Hybrid mailbox state using the msExchRemoteRecipientType attribute (e.g., Migrated, On-Premises, Cloud Archive).

[ Client Health & Inventory ]
- Get-FastPing (fping): High-performance, parallel WMI ping for large lists. It includes a crucial reverse DNS check to verify hostname-IP integrity, preventing stale DNS errors.
- Get-ClientUptime (uptime): Calculates a computer's total uptime and finds all interactively logged-on users with their session duration.
- Get-PendingReboot: Comprehensive check across multiple critical areas (Windows Update, CBS, MECM, Pending File Rename) to determine the exact reason a machine needs a reboot.
- Get-M365UpdateSource: Provides a definitive diagnostic report on how a client’s M365 Apps updates are managed (MECM, GPO, ODT) and the health of the update task.
- Get-OSVersion (os): Retrieves detailed OS information, including the full build (e.g., 22621.2000) and the friendly version name (e.g., 23H2).
- Get-Win10ADClient: Queries AD for Windows 10/11 clients, translating the raw OperatingSystemVersion into a friendly name (e.g., Windows 10 22H2).

[ Session & Access ]
- Get-ClientActivity: Generates a session-grouped timeline of computer power events (Startup, Logon, Sleep, Shutdown) for user activity analysis.
- Get-MappedDrives: Finds all standard (GPO/net use) and Active Directory-assigned home drives for every actively logged-on user session.
- Test-AdminAccess (IsAdmin): Determines if the executing user has local administrative privileges on a target computer, returning a simple boolean or a detailed object.

[ Active Directory Diagnostics ]
- Get-ComputerLastOnline (lastSeen): Finds a computer's most accurate last logon time by optionally querying all Domain Controllers for the non-replicated "lastLogon" attribute.

[ Advanced ]
- Invoke-GarbageCollection (igc): Manually triggers a .NET Garbage Collection in the PowerShell session, useful for memory profiling/cleanup after heavy processing.

--- Sample Daily Workflow ---

Use these functions in concert to quickly triage client issues:

1. Locate a user's PC and get its current health:
  PS> $user = Get-ADUserInfo jdoe; $user.LoggedOnComputers | Get-FastPing

2. If the PC is online, check its status:
  PS> Get-ClientUptime PCNAME -IncludeLoggedInUser

3. If slow, check for pending maintenance:
  PS> Get-PendingReboot PCNAME | Select-Object -ExpandProperty PendingReasons
  PS> Get-M365UpdateSource PCNAME
Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name MapiADTools -RequiredVersion 1.0.2

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name MapiADTools -Version 1.0.2

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2025 Matthias Piplak. All rights reserved.

Package Details

FileList

Version History

Version Downloads Last updated
1.2.0 4 10/10/2025
1.1.0 7 10/1/2025
1.0.2 (current version) 8 9/26/2025
1.0.1 4 9/26/2025
1.0 6 9/26/2025