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
--- 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
Installation Options
Owners
Copyright
(c) 2025 Matthias Piplak. All rights reserved.
Package Details
Author(s)
- Matthias Piplak
Functions
Set-ADUserMustChangePassword Test-ADUserMailboxMigrationStatus Get-ComputerLastOnline Get-ADUserInfo Get-ClientActivity Get-Win10ADClient Get-FastPing Get-ClientUptime Get-M365UpdateSource Get-OSVersion Get-PendingReboot Invoke-GarbageCollection Test-AdminAccess Get-MappedDrives
Dependencies
This module has no dependencies.
FileList
- MapiADTools.nuspec
- MapiADTools.psd1
- MapiADTools.psm1
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 |