MapiADTools.psd1
# # Module manifest for module 'MapiADTools' # # Generated by: Matthias Piplak # # Generated on: 30.09.2025 # @{ # Script module or binary module file associated with this manifest. RootModule = 'MapiADTools.psm1' # Version number of this module. ModuleVersion = '1.1.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely identify this module GUID = '442eccc8-6f06-432d-adcc-b1c2164f650b' # Author of this module Author = 'Matthias Piplak' # Company or vendor of this module CompanyName = 'Matthias Piplak' # Copyright statement for this module Copyright = '(c) 2025 Matthias Piplak. All rights reserved.' # Description of the functionality provided by this module Description = @" MapiADTools is a collection of 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). - Get-ClientFQDN: Gets the Fully Qualified Domain Name (FQDN) for a client based on its sAMAccountName. [ 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 "@ # Minimum version of the Windows PowerShell engine required by this module # PowerShellVersion = '' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the Windows PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # CLRVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @('ActiveDirectory') # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( 'Set-ADUserMustChangePassword', 'Test-ADUserMailboxMigrationStatus', 'Get-ComputerLastOnline', 'Get-ADUserInfo', 'Get-ClientActivity', 'Get-Win10ADClient', 'Get-FastPing', 'Get-ClientUptime', 'Get-M365UpdateSource', 'Set-ADUserMustChangePassword', 'Get-OSVersion', 'Get-PendingReboot', 'Invoke-GarbageCollection', 'Test-AdminAccess', 'Get-MappedDrives', 'Get-ClientUptime', 'Get-ClientFQDN' ) # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @( 'gadu', 'fping', 'os', 'uptime', 'lastSeen', 'IsAdmin', 'FQDN', 'lol' ) # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. # Tags = @() # A URL to the license for this module. # LicenseUri = '' # A URL to the main website for this project. # ProjectUri = '' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module # ReleaseNotes = '' } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } |