PowerShell Genie
Site index

Site index

Find a command, follow a lesson or choose an admin task. Search the directory or browse by section.

Index 596 pages

Browse sections11 pages

Lessons & guides89 pages

  • AD Sync PowerShell commands for Microsoft Entra Connect

    Inspect the Entra Connect scheduler, choose Delta or Initial sync and verify connector results before declaring directory synchronization complete.

  • Build an Active Directory account review

    Query users, groups and domain controllers; validate directory state before making changes.

  • Azure PowerShell

    Learn Azure PowerShell administration with the Az module. Explore command examples, inspect the results and practice working with Azure resources and context.

  • Check your PowerShell version and edition

    Check $PSVersionTable, distinguish Windows PowerShell from PowerShell 7 and identify the executable used by a script or scheduled task.

  • Exchange Online PowerShell

    Learn Exchange Online PowerShell for mailbox and mail-flow administration. Follow command examples, interpret the output and practice working with cloud mail.

  • Execution Policy

    Identify which policy applies before changing a setting or unblocking a script. Read the command examples and check the expected output.

  • Review large log files before touching them

    Copy, query, compare and export files while checking paths, encoding, byte counts and integrity.

  • Filtering with Where-Object

    Learn how Where-Object tests each pipeline object one at a time with comparison operators like -eq, -gt, and -like.

  • Get-Command tutorial: discover PowerShell commands

    Learn to discover PowerShell commands with Get-Command. Filter by verb, noun or module, inspect available commands and practice with explained examples.

  • Get-Help tutorial: read syntax and examples

    Learn to use Get-Help in PowerShell to find syntax, parameters and examples. Explore the help system and practice checking command usage before running scripts.

  • Get-Member tutorial: inspect PowerShell objects

    Learn to inspect PowerShell objects with Get-Member. Discover their types, properties and methods, interpret the output and apply the lesson in an exercise.

  • Installing PowerShell

    Learn to install and verify PowerShell, identify the executable in use and check your version. Follow practical examples before starting your scripting work.

  • Check tenant, permission and completeness in Graph

    Connect to the right tenant, request the required permissions and inspect cloud inventory as objects.

  • Microsoft Graph PowerShell

    Learn Microsoft Graph PowerShell for cloud identity administration. Explore command examples, understand returned objects and practice Microsoft cloud queries.

  • Modules

    Learn how PowerShell modules package reusable automation. Explore module examples, understand their structure and practice organizing commands for reuse.

  • Objects versus text

    Understand how PowerShell object pipelines differ from text processing, inspect properties and keep structured data available for the next command.

  • PowerShell 5.1 and PowerShell 7

    Windows PowerShell 5.1 vs PowerShell 7: key differences, .NET Framework vs .NET, and what works where. Know which version to target for your scripts.

  • PowerShell AD computers

    Learn to inventory Active Directory computer accounts with PowerShell. Follow query examples, inspect returned properties and practice interpreting the results.

  • PowerShell AD groups

    Learn Active Directory group management with PowerShell. Explore group membership and structure through command examples, explained output and a practice task.

  • PowerShell AD replication

    Learn to diagnose Active Directory replication with PowerShell. Follow examples, inspect returned results and practice investigating replication failures.

  • PowerShell AD users

    Learn to query and manage Active Directory users with PowerShell. Follow command examples, inspect user properties and practice working with directory objects.

  • PowerShell Active Directory module

    Manage AD users, groups, computers and OUs with the ActiveDirectory module. Installation, key cmdlets like Get-ADUser, and hands-on examples.

  • PowerShell Advanced functions

    Turn plain functions into advanced functions with [CmdletBinding()]. Get -Verbose, -Debug and common parameters for free, plus pipeline support and validation.

  • PowerShell Arrays

    Learn PowerShell arrays for working with collections. Follow examples for reading values, understand the output and practice processing multiple items.

  • PowerShell Background jobs

    Run long tasks without blocking your prompt using PowerShell background jobs. Start-Job, Get-Job, Receive-Job and Wait-Job explained with practical examples.

  • PowerShell CIM versus WMI

    Learn the differences between CIM and WMI in PowerShell. Explore the Windows management interface through command examples, explained results and an exercise.

  • PowerShell CSV

    Learn to import and export CSV data in PowerShell. Follow examples, understand how rows become objects and practice moving tabular data through your scripts.

  • PowerShell Code signing

    Learn PowerShell code signing and trust verification. Follow examples for signed scripts, inspect the results and practice checking trust before execution.

  • PowerShell Comparison operators

    PowerShell Comparison operators: read the examples, check prerequisites and follow the explanation before using the command in your environment.

  • PowerShell DNS troubleshooting

    Compare the same DNS question across the resolution paths your application actually uses. Read the command examples and check the expected output.

  • PowerShell Desired State Configuration

    Describe what a machine should look like and let DSC make it so. Write Configuration blocks with resources that declare desired state, not steps.

  • PowerShell Entra users and groups

    Manage Entra ID users and groups through Microsoft Graph with PowerShell. Learn the cmdlets, avoid common pitfalls, and script identity tasks safely.

  • PowerShell ErrorRecord

    Learn to inspect PowerShell ErrorRecord objects beyond the error headline. Follow diagnostic examples and practice reading exception details to trace failures.

  • PowerShell Event logs

    Learn to query Windows event logs with PowerShell. Explore diagnostic and security log examples, interpret the results and practice narrowing a query.

  • PowerShell FSMO roles

    Learn Active Directory FSMO roles and inspect operations master role holders with PowerShell. Follow examples and practice interpreting domain information.

  • PowerShell Firewall administration

    Control Windows Firewall with the NetSecurity module. Get-NetFirewallRule, New-NetFirewallRule and Set-NetFirewallRule with real-world rule examples.

  • PowerShell ForEach-Object -Parallel

    Speed up loops with ForEach-Object -Parallel in PowerShell 7. Run iterations concurrently in separate runspaces and learn throttle limits and gotchas.

  • PowerShell Functions

    Learn to turn repeated PowerShell commands into reusable functions. Follow worked examples, understand function behavior and practice organizing script logic.

  • PowerShell GPO troubleshooting

    Trace the effective policy for an affected user and computer instead of guessing from a GPO link. Read the command examples and check the expected output.

  • PowerShell Hashtables

    Learn PowerShell hashtables for key-value data. Follow examples for storing and reading entries, inspect the output and practice using structured lookups.

  • PowerShell JEA

    Learn Just Enough Administration in PowerShell to constrain operator capabilities. Explore examples, understand access models and practice applying the lesson.

  • PowerShell JSON

    Learn to work with JSON in PowerShell for APIs and configuration. Follow conversion examples, inspect returned objects and practice handling structured data.

  • PowerShell Kerberos and SPNs

    Understand Service Principal Names and how Kerberos authentication works. Diagnose SPN issues that cause silent NTLM fallback or outright auth failures.

  • PowerShell Least privilege automation

    Stop over-privileging automation accounts. Learn to scope service accounts and scheduled tasks to minimum rights without breaking scripts.

  • PowerShell Module architecture

    Structure PowerShell modules others can actually use. Learn the conventional layout: public vs private functions, manifests, one function per file.

  • PowerShell Operational runbooks

    Write runbooks someone can follow at 3 AM. Learn to document procedures clearly, then automate from the runbook with PowerShell.

  • PowerShell PSCustomObject

    Learn to build PowerShell reporting objects with PSCustomObject. Follow examples for named properties, inspect the output and practice creating structured data.

  • PowerShell PSScriptAnalyzer

    Catch bugs before runtime with PSScriptAnalyzer. Run Invoke-ScriptAnalyzer to check code against best-practice rules without executing anything.

  • PowerShell Parameters and validation

    Reject invalid inputs at the boundary and explain what your function accepts. Read the command examples and check the expected output.

  • PowerShell Performance measurement

    Find slow code with Measure-Command. Learn to benchmark script blocks, compare approaches, and spot performance bottlenecks in your automation.

  • PowerShell Pester

    Learn to write automated PowerShell tests with Pester. Follow worked examples, understand assertions and test results, then practice verifying script behavior.

  • PowerShell Pipeline binding

    Make your functions accept pipeline input. Learn [Parameter(ValueFromPipeline)], process blocks, and how objects flow between commands.

  • PowerShell Processes

    Learn to inspect CPU and memory usage with PowerShell process commands. Follow examples, interpret process properties and practice investigating programs.

  • PowerShell REST APIs

    Learn to call REST APIs with PowerShell and handle structured responses. Follow request examples, inspect returned objects and practice using service data.

  • PowerShell Regex and wildcards

    Stop mixing up PowerShell's two pattern systems. Learn when to use wildcards vs regex, with -like, -match and -replace explained through examples.

  • PowerShell Remoting

    Learn PowerShell remoting for remote Windows administration. Follow command examples, understand session behavior and practice working with remote results.

  • PowerShell Runspaces

    Learn how PowerShell runspaces support concurrent work. Explore execution examples, understand the output and practice the concepts behind parallel automation.

  • PowerShell SSH remoting

    Learn cross-platform PowerShell remoting over SSH. Review the session examples, understand remote command execution and practice interpreting returned output.

  • PowerShell Scheduled Tasks

    Automate with the ScheduledTasks module. Build tasks from actions, triggers and principals, then register them with Register-ScheduledTask.

  • PowerShell Scope

    Learn PowerShell scope and variable visibility. Follow examples showing variable visibility, inspect the results and practice reasoning about script state.

  • PowerShell Script governance

    Keep your script library from becoming a liability. Learn versioning, review practices, and standards that make automation safe to change.

  • PowerShell Services

    Learn to inspect and control Windows services with PowerShell. Follow examples, understand service state and practice checking results before taking action.

  • PowerShell Sites and Services

    Check client subnet mapping and replication topology as separate parts of a site problem. Read the command examples and check the expected output.

  • PowerShell Splatting

    Learn how to pass named parameters with a PowerShell hashtable, keep command calls readable and reuse options with splatting.

  • PowerShell Thread jobs

    Learn lightweight PowerShell concurrency with thread jobs. Follow examples for starting work and collecting results, then practice inspecting job behavior.

  • PowerShell Transcript logging

    Record every command and output with Start-Transcript and Stop-Transcript. Create audit trails for change windows and incident response.

  • PowerShell Verbose and diagnostic streams

    Master PowerShell's six output streams. Learn when to use Write-Verbose, Write-Debug and Write-Warning, and how to redirect each stream.

  • PowerShell WinRM

    Learn WinRM prerequisites for Windows PowerShell remoting. Follow the examples, understand connection requirements and practice checking your remoting setup.

  • PowerShell Windows networking

    Replace ipconfig with objects. Use Get-NetAdapter, Get-NetIPAddress and Get-NetRoute from the NetTCPIP module for scriptable network admin.

  • Find the failing operation before changing the script

    Read error records, test assumptions and preserve useful evidence when automation fails.

  • PowerShell for / while / do

    Master PowerShell's three remaining loops: for, while, and do. Learn when each runs, how conditions are tested, and avoid infinite loops with clear examples.

  • PowerShell foreach

    Learn to iterate collections with foreach in PowerShell. Follow worked examples, understand how each item is processed and practice writing your own loop.

  • PowerShell if / elseif / else

    Control script flow with if, elseif and else. Learn condition syntax, comparison operators, and how PowerShell evaluates truthiness in branching logic.

  • PowerShell in CI/CD

    Learn to treat PowerShell scripts as software in CI/CD workflows. Follow examples, understand automated checks and practice preparing scripts for a pipeline.

  • Build a report from PowerShell objects

    Learn filters, projections, sorting, functions and data types, then check your understanding in the practice console.

  • Locate the layer that breaks a remote session

    Diagnose WinRM, sessions, remote queries and authentication with checks that isolate the failing layer.

  • PowerShell switch

    Learn the PowerShell switch statement for handling multiple cases. Follow worked examples, understand matching behavior and practice choosing the right branch.

  • PowerShell try, catch and finally

    Learn which errors catch handles, when to use ErrorAction Stop and how finally supports cleanup after a command succeeds or fails.

  • $ErrorActionPreference: the dial behind every error

    Learn how $ErrorActionPreference decides what happens after a cmdlet error. Compare Continue, SilentlyContinue, Stop, and Inquire.

  • Providers and PSDrives

    Navigate the registry, certificates and variables like filesystems. Learn PowerShell providers and PSDrives: Get-ChildItem and Set-Location work everywhere.

  • Run PowerShell commands and scripts from CMD

    Launch powershell.exe or pwsh from CMD, choose -File or -Command, quote paths correctly and inspect the process exit code.

  • SharePoint Online PowerShell

    Learn SharePoint Online administration with PowerShell. Explore site and permission management examples, inspect results and practice administrative queries.

  • Teams PowerShell

    Learn Microsoft Teams administration with PowerShell. Follow command examples, inspect returned data and practice using Teams queries in administrative work.

  • The pipeline

    Learn how the PowerShell pipeline passes objects between commands. Follow examples, inspect properties and practice combining commands into useful queries.

  • Update PowerShell on Windows without confusing editions

    Update PowerShell 7, distinguish engine updates from module updates and verify which executable your automation uses after the change.

  • Variables

    Learn how PowerShell variables store values and how scope affects access. Follow assignment examples, inspect output and practice using variables in scripts.

  • What is PowerShell?

    Learn what PowerShell is, how its object pipeline works and how it differs from a traditional command prompt. Explore examples and try the lesson exercise.

  • Windows Update PowerShell commands: inventory and checks

    Inspect installed hotfixes, understand Get-HotFix coverage and distinguish Windows Update automation from PowerShell and module updates.

  • Read process memory without guessing at CPU load

    Inspect service state, process memory, CPU totals, event logs and scheduled tasks without confusing state with health.

  • Your first Verb-Noun command

    Every PowerShell command is Verb-Noun. Learn the naming pattern so you can guess Get-Process, Stop-Service and New-Item correctly on the first try.

Practice exercises40 pages

Projects & site information5 pages

Guided project1 pages

Tools & activities30 pages

Commands182 pages

  • Add-ADGroupMember

    Use Add-ADGroupMember to add users, computers or other groups to an Active Directory group.

  • Add-Content

    Use Add-Content to append a value to the end of a file, leaving existing content in place.

  • Clear-Content

    Use Clear-Content to empty a file without deleting it, leaving a zero-length file behind.

  • Compare-Object

    Use Compare-Object to compare two sets of objects and report which items are only in one of them.

  • Compress-Archive

    Use Compress-Archive to create a zip archive from files or folders.

  • Connect-AzAccount

    Use Connect-AzAccount to sign in to Azure and verify the tenant and subscription context. See Az module requirements and examples.

  • Connect-ExchangeOnline

    Use Connect-ExchangeOnline to connect to Exchange Online and verify the administrator session. See ExchangeOnlineManagement module requirements and examples.

  • Connect-MgGraph

    Use Connect-MgGraph to connect to Microsoft Graph with delegated or app-only authentication. See Microsoft.Graph module requirements and examples.

  • ConvertFrom-Json

    Use ConvertFrom-Json to convert a JSON-formatted string to a PowerShell object. See Microsoft.PowerShell.Utility module requirements and examples.

  • ConvertTo-Json

    Use ConvertTo-Json to convert an object to a JSON-formatted string. See Microsoft.PowerShell.Utility module requirements and examples.

  • ConvertTo-Xml

    Use ConvertTo-Xml to convert objects into an XML representation of their properties.

  • Copy-Item

    Use Copy-Item to copy files or directories. Review path handling, recursive copies and examples before choosing a destination.

  • Disable-ADAccount

    Use Disable-ADAccount to disable an Active Directory user or computer account, blocking sign-in while keeping the object.

  • Enable-ADAccount

    Use Enable-ADAccount to enable a disabled Active Directory user or computer account.

  • Enter-PSSession

    Use Enter-PSSession to start an interactive remoting session, redirecting your prompt to a remote computer.

  • Expand-Archive

    Use Expand-Archive to extract the contents of a zip archive to a folder.

  • Export-Csv

    Use Export-Csv to convert objects into CSV-formatted data and write it to a file. See Microsoft.PowerShell.Utility module requirements and examples.

  • Find-Module

    Use Find-Module to search a registered repository for modules without installing anything.

  • ForEach-Object

    Use ForEach-Object to perform an operation on each item in a collection of input objects. See Microsoft.PowerShell.Utility module requirements and examples.

  • Format-List

    Use Format-List to render each object as a vertical list of property names and values.

  • Format-Table

    Use Format-Table to render objects as a table of columns for display.

  • Get-ADComputer

    Use Get-ADComputer to retrieve computer accounts from Active Directory.

  • Get-ADDomain

    Use Get-ADDomain to return information about an Active Directory domain, including its FSMO role holders and naming contexts.

  • Get-ADDomainController

    Use Get-ADDomainController to retrieve domain controllers in a domain or forest, with their roles, site and status.

  • Get-ADForest

    Use Get-ADForest to return information about an Active Directory forest, including its domains, sites and forest-level role holders.

  • Get-ADGroup

    Use Get-ADGroup to retrieve security and distribution groups from Active Directory.

  • Get-ADGroupMember

    Use Get-ADGroupMember to list the members of an Active Directory group, optionally expanding nested groups.

  • Get-ADObject

    Use Get-ADObject to retrieve any object from Active Directory regardless of type, including deleted objects.

  • Get-ADOrganizationalUnit

    Use Get-ADOrganizationalUnit to list Active Directory OUs with their distinguished names — the containers Group Policy and delegated administration target.

  • Get-ADReplicationFailure

    Use Get-ADReplicationFailure to report AD replication failures per domain controller, so an unreplicated change stops looking like a permissions problem.

  • Get-ADReplicationPartnerMetadata

    Use Get-ADReplicationPartnerMetadata to show when each replication partner last succeeded — the complement to Get-ADReplicationFailure.

  • Get-ADUser

    Use Get-ADUser to retrieve user accounts from Active Directory by identity, filter or LDAP query.

  • Get-Acl

    Use Get-Acl to return the security descriptor of a file, folder, registry key or other securable object.

  • Get-Alias

    Use Get-Alias to list the aliases defined in the session, or resolve an alias to the command it points at.

  • Get-AuthenticodeSignature

    Use Get-AuthenticodeSignature to read a file's signature status: Valid, NotSigned, HashMismatch, NotTrusted, NotSupportedFileFormat, or UnknownError.

  • Get-AzContext

    Use Get-AzContext to inspect the active Azure account, tenant and subscription. See Az module requirements and examples.

  • Get-AzDisk

    Use Get-AzDisk to inventory Azure managed disks and inspect attachment state. See Az module requirements and examples.

  • Get-AzKeyVault

    Use Get-AzKeyVault to list Azure vault resources and distinguish access to secret values. See Az module requirements and examples.

  • Get-AzResource

    Use Get-AzResource to inventory Azure resources by resource group and resource type. See Az module requirements and examples.

  • Get-AzResourceGroup

    Use Get-AzResourceGroup to query Azure resource groups and inspect location and tags. See Az module requirements and examples.

  • Get-AzRoleAssignment

    Use Get-AzRoleAssignment to query Azure role assignments by identity, scope and role. See Az module requirements and examples.

  • Get-AzStorageAccount

    Use Get-AzStorageAccount to inventory Azure storage accounts and inspect configuration. See Az module requirements and examples.

  • Get-AzSubscription

    Use Get-AzSubscription to list accessible Azure subscriptions and inspect their tenant IDs. See Az module requirements and examples.

  • Get-AzVM

    Use Get-AzVM to retrieve Azure VM configuration and check power state with Status. See Az module requirements and examples.

  • Get-ChildItem

    Use Get-ChildItem to get the items and child items in one or more specified locations.

  • Get-CimInstance

    Use Get-CimInstance to get instances of CIM classes from a CIM server. See CimCmdlets module requirements and examples.

  • Get-CimSession

    Use Get-CimSession to list the CIM sessions open in the current PowerShell session.

  • Get-Command

    Use Get-Command to get information about PowerShell commands, including cmdlets, aliases, functions, filters, scripts, applications, and external commands.

  • Get-ComputerInfo

    Use Get-ComputerInfo to return a single object with over a hundred properties describing the operating system and hardware.

  • Get-Content

    Use Get-Content to get the content of an item at the specified location, most commonly a text file.

  • Get-Counter

    Use Get-Counter to read Windows performance counter values, once or as a continuous sample.

  • Get-Date

    Use Get-Date to return the current date and time, or convert and format a date you supply.

  • Get-DistributionGroup

    Use Get-DistributionGroup to list distribution groups and mail-enabled security groups. See ExchangeOnlineManagement module requirements and examples.

  • Get-DistributionGroupMember

    Use Get-DistributionGroupMember to list a distribution group's direct members; nested groups are separate objects.

  • Get-DnsClientServerAddress

    Use Get-DnsClientServerAddress to show the DNS servers configured per network interface.

  • Get-EXOMailbox

    Use Get-EXOMailbox to inventory Exchange Online mailboxes with explicit properties. See ExchangeOnlineManagement module requirements and examples.

  • Get-EXOMailboxPermission

    Use Get-EXOMailboxPermission to inspect mailbox permissions — User, AccessRights, IsInherited and Deny together.

  • Get-EXOMailboxStatistics

    Use Get-EXOMailboxStatistics to return mailbox storage statistics such as TotalItemSize.

  • Get-Error

    Use Get-Error to display the most recent errors in full detail, including nested exceptions and invocation information.

  • Get-ExecutionPolicy

    Use Get-ExecutionPolicy to report the effective execution policy, or the policy set at each scope with -List.

  • Get-FileHash

    Use Get-FileHash to compute a cryptographic hash of a file, defaulting to SHA256.

  • Get-GPO

    Use Get-GPO to retrieve Group Policy objects by name, GUID or full inventory. See GroupPolicy module requirements and examples.

  • Get-GPOReport

    Use Get-GPOReport to export Group Policy reports as HTML or XML for inspection. See GroupPolicy module requirements and examples.

  • Get-Help

    Look up syntax, parameters and examples for a PowerShell command. Use the help output to understand a command before running it.

  • Get-History

    Use Get-History to return the commands run in the current session, with an id for each.

  • Get-HotFix

    Use Get-HotFix to list installed updates that were delivered as hotfix packages.

  • Get-InboundConnector

    Use Get-InboundConnector to inspect inbound mail connectors and their sender restrictions. See ExchangeOnlineManagement module requirements and examples.

  • Get-InboxRule

    Use Get-InboxRule to inspect mailbox inbox rules, including hidden rules and forwarding. See ExchangeOnlineManagement module requirements and examples.

  • Get-InstalledModule

    Use Get-InstalledModule to list modules installed by Install-Module, with the version and repository they came from.

  • Get-Item

    Use Get-Item to return the item at a path — file, folder, registry key, or any provider item — to inspect its properties.

  • Get-Job

    Use Get-Job to list the jobs in the session with their current state.

  • Get-LocalGroup

    Use Get-LocalGroup to list local security groups on a Windows machine.

  • Get-LocalGroupMember

    Use Get-LocalGroupMember to list the members of a local group, including domain accounts that belong to it.

  • Get-LocalUser

    Use Get-LocalUser to list local user accounts on a Windows machine with their enabled state and password settings.

  • Get-Location

    Use Get-Location to return the current working directory for the session.

  • Get-Member

    Use Get-Member to list an object's properties and methods — the fastest way to discover what pipeline output can do.

  • Get-MgApplication

    Use Get-MgApplication to list app registrations and inspect credential expiry in Microsoft Graph.

  • Get-MgAuditLogSignIn

    Use Get-MgAuditLogSignIn to query Entra sign-in logs with date filters and pagination. See Microsoft.Graph module requirements and examples.

  • Get-MgGroup

    Use Get-MgGroup to list Microsoft Graph groups and distinguish their membership types. See Microsoft.Graph module requirements and examples.

  • Get-MgGroupMember

    Use Get-MgGroupMember to enumerate direct Microsoft Graph group members with pagination. See Microsoft.Graph module requirements and examples.

  • Get-MgServicePrincipal

    Use Get-MgServicePrincipal to list tenant service principals and distinguish object IDs from application IDs.

  • Get-MgSubscribedSku

    Use Get-MgSubscribedSku to compare purchased and consumed Microsoft 365 license units. See Microsoft.Graph module requirements and examples.

  • Get-MgUser

    Use Get-MgUser to query Microsoft Graph users with pagination and explicit properties. See Microsoft.Graph module requirements and examples.

  • Get-MgUserAuthenticationMethod

    Use Get-MgUserAuthenticationMethod to list a user's registered authentication methods.

  • Get-Module

    Use Get-Module to list modules loaded in the session, or with -ListAvailable those installed and ready to load.

  • Get-NetAdapter

    Use Get-NetAdapter to list the network adapters on a Windows machine with their status, speed and MAC address.

  • Get-NetFirewallRule

    Use Get-NetFirewallRule to list Windows Firewall rules with their direction, action and enabled state.

  • Get-NetIPAddress

    Use Get-NetIPAddress to list the IP addresses configured on the machine's interfaces.

  • Get-NetIPConfiguration

    Use Get-NetIPConfiguration to return a per-interface summary combining IP address, gateway and DNS servers.

  • Get-NetRoute

    Use Get-NetRoute to list the machine's IP routing table entries with their destinations and metrics.

  • Get-NetTCPConnection

    Use Get-NetTCPConnection to list TCP connections and listening ports with the owning process id.

  • Get-OutboundConnector

    Use Get-OutboundConnector to inspect outbound mail connectors and recipient routing settings. See ExchangeOnlineManagement module requirements and examples.

  • Get-PSDrive

    Use Get-PSDrive to list the drives available in the session, including those that are not filesystems.

  • Get-PSSession

    Use Get-PSSession to list the PSSessions in the current session, or those available on a remote computer.

  • Get-Process

    Use Get-Process to get the processes that are running on the local computer.

  • Get-Random

    Use Get-Random to return a random number, or pick random items from a collection.

  • Get-SPOSite

    Use Get-SPOSite to inventory SharePoint Online site collections and check query limits.

  • Get-SPOUser

    Use Get-SPOUser to list users in a SharePoint site collection and check access assumptions.

  • Get-ScheduledTask

    Use Get-ScheduledTask to list scheduled tasks with their definitions, triggers and current state.

  • Get-ScheduledTaskInfo

    Use Get-ScheduledTaskInfo to return run history for a scheduled task: last run time, last result and next run time.

  • Get-Service

    Command reference for Get-Service: list services, filter by status, and inspect service objects in the pipeline.

  • Get-Team

    Use Get-Team to inventory Microsoft Teams and check account visibility limits. See MicrosoftTeams module requirements and examples.

  • Get-TransportRule

    Use Get-TransportRule to inspect Exchange mail-flow rules, priorities, conditions and modes. See ExchangeOnlineManagement module requirements and examples.

  • Get-Variable

    Use Get-Variable to list the variables in the current scope, or retrieve one by name.

  • Get-WinEvent

    Use Get-WinEvent to get events from event logs and event tracing log files on local and remote computers.

  • Group-Object

    Use Group-Object to group objects that share a value for one or more properties, and count each group.

  • Import-Csv

    Use Import-Csv to read a CSV file and return one object per row, with the header line becoming property names.

  • Import-Module

    Use Import-Module to load a module into the session so its commands are available.

  • Install-Module

    Use Install-Module to download a module from a registered repository and install it for the current user or all users.

  • Invoke-Command

    Use Invoke-Command to run a command or script block on one or more remote computers and return the results.

  • Invoke-RestMethod

    Use Invoke-RestMethod to call a REST endpoint and convert the JSON or XML response into PowerShell objects automatically.

  • Invoke-WebRequest

    Use Invoke-WebRequest to fetch a URL and return the full response: status code, headers, and the raw or parsed content.

  • Join-Path

    Use Join-Path to combine path segments into one path using the correct separator for the platform.

  • Measure-Object

    Use Measure-Object to count objects, or calculate sum, average, minimum and maximum for a numeric property.

  • Move-ADObject

    Use Move-ADObject to move an Active Directory object to a different organizational unit or container.

  • Move-Item

    Use Move-Item to move a file or directory to a new location, and rename it if you change the leaf name.

  • New-ADComputer

    Use New-ADComputer to create a computer account in Active Directory before the machine joins the domain.

  • New-ADGroup

    Use New-ADGroup to create a security or distribution group in Active Directory.

  • New-ADUser

    Use New-ADUser to create an Active Directory user account with identity attributes like -Name, -SamAccountName, -UserPrincipalName, and -AccountPassword.

  • New-CimSession

    Use New-CimSession to create a reusable CIM session to a remote computer for use with the CIM cmdlets.

  • New-GPO

    Use New-GPO to create a Group Policy object and verify its GUID before linking it. See GroupPolicy module requirements and examples.

  • New-Item

    Use New-Item to create a new item, such as a file, directory, registry key, or provider-specific object.

  • New-PSSession

    Use New-PSSession to open a persistent connection to a remote computer and return a session object.

  • Out-File

    Use Out-File to write the formatted text representation of objects to a file.

  • Out-Host

    Use Out-Host to send output to the host for display, optionally one screen at a time.

  • Out-String

    Use Out-String to convert objects into the string form PowerShell would have displayed.

  • Receive-Job

    Use Receive-Job to collect the output of a job and, by default, remove it from the job's buffer.

  • Register-ScheduledTask

    Use Register-ScheduledTask to create a scheduled task from action, trigger, principal and settings objects.

  • Remove-ADGroupMember

    Use Remove-ADGroupMember to remove members from an Active Directory group.

  • Remove-ADUser

    Use Remove-ADUser to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo.

  • Remove-CimSession

    Use Remove-CimSession to close CIM sessions and release their connections.

  • Remove-Item

    Use Remove-Item to delete files, folders, registry keys, or other provider items; -Recurse and -Force clear non-empty trees.

  • Remove-Job

    Use Remove-Job to delete a job from the session, discarding any output it still holds.

  • Remove-Module

    Use Remove-Module to unload an imported module from the current session — handy when testing a new version of your own module.

  • Remove-PSSession

    Use Remove-PSSession to close a PSSession and release the resources it holds on the remote computer.

  • Remove-Variable

    Use Remove-Variable to delete a variable and its value from the session; -Force also clears read-only variables.

  • Resolve-DnsName

    Use Resolve-DnsName to query DNS for a name or address and return the records, bypassing the local cache when asked.

  • Resolve-Path

    Use Resolve-Path to turn a relative path or a wildcard into one or more full paths, failing if nothing matches.

  • Restart-Computer

    Use Restart-Computer to restart the local computer or a remote one by name; -WhatIf shows the target without restarting, and -Wait blocks until a remote Windows endpoint responds again.

  • Restart-Service

    Use Restart-Service to stop and then start one or more Windows services.

  • Save-Module

    Use Save-Module to download a module and its dependencies to a folder without installing it.

  • Search-ADAccount

    Use Search-ADAccount to find accounts matching a built-in condition such as locked out, disabled, expired or inactive.

  • Select-Object

    Use Select-Object to keep only chosen properties, take the first N objects, or expand one property into its values.

  • Set-ADComputer

    Use Set-ADComputer to modify attributes on an existing Active Directory computer account.

  • Set-ADUser

    Use Set-ADUser to modify attributes on an existing Active Directory user account.

  • Set-Acl

    Use Set-Acl to apply a security descriptor to a file, folder or registry key.

  • Set-AuthenticodeSignature

    Use Set-AuthenticodeSignature to sign a script with a code-signing certificate, proving origin and integrity.

  • Set-AzContext

    Use Set-AzContext to select and verify the Azure subscription and tenant for later commands. See Az module requirements and examples.

  • Set-Content

    Use Set-Content to replace the entire contents of a file with the value you supply.

  • Set-ExecutionPolicy

    Use Set-ExecutionPolicy to change the execution policy for a scope, controlling whether script files may run.

  • Set-GPLink

    Use Set-GPLink to change GPO link order, enforcement and enabled state for a target OU. See GroupPolicy module requirements and examples.

  • Set-Location

    Use Set-Location to change the current working directory, on any drive a provider exposes.

  • Set-NetFirewallRule

    Use Set-NetFirewallRule to change properties of existing Windows Firewall rules.

  • Set-Service

    Use Set-Service to start, stop or suspend a service, and change service properties such as StartupType and DisplayName.

  • Set-Variable

    Use Set-Variable to create or change a variable, with control over its scope and options.

  • Sort-Object

    Use Sort-Object to order objects by property, ascending by default or -Descending; -Unique drops duplicates.

  • Split-Path

    Use Split-Path to return one part of a path: the parent directory, the file name, the extension, or the qualifier.

  • Start-ADSyncSyncCycle

    Use Start-ADSyncSyncCycle to request a Microsoft Entra Connect Sync cycle after checking scheduler state and the intended server.

  • Start-Job

    Use Start-Job to run a script block in a separate background process and return a job object immediately.

  • Start-Process

    Use Start-Process to launch an executable or open a file with its associated program.

  • Start-ScheduledTask

    Use Start-ScheduledTask to run a scheduled task immediately, without waiting for its trigger.

  • Start-Service

    Use Start-Service to start a stopped Windows service by name or display name.

  • Start-ThreadJob

    Use Start-ThreadJob to run a script block on a thread inside the current process and return a job object.

  • Start-Transcript

    Use Start-Transcript to begin recording the session, both commands and their output, to a text file.

  • Stop-Job

    Use Stop-Job to stop a running job, leaving it in the session so partial output can still be collected.

  • Stop-Process

    Use Stop-Process to stop running processes by name or ID; -Force ends processes that ignore a normal stop request.

  • Stop-ScheduledTask

    Use Stop-ScheduledTask to terminate a running instance of a scheduled task.

  • Stop-Service

    Use Stop-Service to stop a running Windows service; -Force also stops services that depend on it.

  • Stop-Transcript

    Use Stop-Transcript to end the current transcript and close the file. See Microsoft.PowerShell.Host module requirements and examples.

  • Tee-Object

    Use Tee-Object to pass objects along the pipeline while also saving them to a file or a variable.

  • Test-NetConnection

    Use Test-NetConnection to test connectivity to a host, optionally on a specific TCP port, and report the route and DNS resolution.

  • Test-Path

    Use Test-Path to return $true or $false for whether a path exists — the guard to run before reading, writing, or deleting.

  • Trace-Command

    Use Trace-Command to trace PowerShell's internal operations while running an expression, showing how it resolved what you asked for.

  • Unlock-ADAccount

    Use Unlock-ADAccount to clear the lockout on an Active Directory account after too many failed sign-in attempts. Review examples and related commands.

  • Wait-Process

    Use Wait-Process to block until one or more processes exit, or until a timeout expires.

  • Where-Object

    Use Where-Object to select objects from a collection based on their property values. See Microsoft.PowerShell.Utility module requirements and examples.

  • Write-Debug

    Use Write-Debug to write a developer-facing message to the debug stream, hidden unless -Debug is passed.

  • Write-Error

    Use Write-Error to write a non-terminating error to the error stream without stopping execution.

  • Write-Information

    Use Write-Information to write a tagged message to the information stream, which can be captured separately from output.

  • Write-Output

    Use Write-Output to send objects to the success stream, which is the stream the pipeline carries and a caller can capture.

  • Write-Verbose

    Use Write-Verbose to write a diagnostic message that stays hidden unless the caller asks for it with -Verbose.

  • Write-Warning

    Use Write-Warning to write a message to the warning stream, shown by default but kept out of your data.

Modules27 pages

Scripts110 pages

  • Audit Hyper-V replication

    Get-VMReplication returns the replication configuration for each participating guest, and the projection keeps the VM name with State, Health, and LastReplicationTime.

  • Audit PowerShell script block logging

    Read the PowerShell ScriptBlockLogging policy registry key with Get-ItemProperty and interpret missing settings before drawing conclusions.

  • Audit firewall profiles

    Get-NetFirewallProfile returns one object per profile, and Select-Object reports the profile name with Enabled plus the two default action fields.

  • Audit inbound firewall block rules

    Get-NetFirewallRule is constrained by three parameters at once, returning rules that are enabled, inbound, and set to block.

  • Audit offboarding state

    A single Get-ADUser call requests Enabled, MemberOf and LastLogonDate for the account named in $Sam.

  • Audit privileged groups

    An array holds the four group names worth watching, and the loop calls Get-ADGroupMember with -Recursive on each so nested membership is flattened into leaf members.

  • Audit users with risky delegation flags

    Get-ADUser requests the delegation-related properties explicitly because they are not returned by default.

  • Bulk add users to a group from CSV

    Import-Csv reads the file into objects with one property per column, and ForEach-Object calls Add-ADGroupMember once per row.

  • Capture a terminating error

    Get-Item runs with -EA Stop, which promotes its non-terminating error into a terminating one so control transfers into the catch block.

  • Check AD replication failures

    Get-ADReplicationPartnerMetadata with -Target * and -Scope Domain collects the metadata each controller keeps about its replication partners.

  • Check Windows Defender status

    Get-MpComputerStatus returns the live state of the Defender engine as a single object.

  • Check certificate files in a folder

    Get-ChildItem recurses through $Path with a -Filter of *.cer and reports each match with its full path, last write time, and size.

  • Check pending reboot indicator

    Inspect a Windows pending reboot indicator with PowerShell. Review the specific check and its limits before using it in a wider maintenance workflow.

  • Collect hardware summary

    Collect CPU model, RAM in GiB, and BIOS version with Get-CimInstance, then combine the results into one PowerShell object.

  • Collect hotfix history

    Get-HotFix wraps the Win32_QuickFixEngineering class and returns one row per servicing update.

  • Collect recent system errors

    Query recent System errors with a server-side Get-WinEvent filter. Inspect the event time, ID and provider to focus the investigation.

  • Compare DNS answers across servers

    The loop asks each server in $DnsServers to resolve $Name and stamps the responding server onto every record with a calculated property.

  • Compare a copied file with SHA256

    Get-FileHash reads each file using SHA256. LiteralPath treats brackets in filenames literally.

  • Compare two directory inventories

    Both sides get enumerated with Get-ChildItem into a projection of FullName, Length, and LastWriteTime, and Compare-Object is told to compare on exactly those three properties.

  • Connector inventory

    Inventory Exchange Online inbound and outbound connectors, including enabled state, connector type, and outbound recipient domains.

  • Create a calculated property

    Select-Object accepts a hashtable with an n key naming the new column and an e key holding a script block that computes its value.

  • Create a custom reporting object

    The [pscustomobject] cast applied to a hashtable literal produces one object whose properties are the hashtable keys, in the order they were written.

  • Distribution group inventory

    Get-DistributionGroup with -ResultSize Unlimited enumerates every distribution and mail-enabled security group, and the projection keeps just the display name and primary SMTP address.

  • Distribution group membership audit

    The outer enumeration returns every distribution group, and for each one Get-DistributionGroupMember lists its members with its own unlimited result size.

  • Explain pipeline members

    Get-Process emits its objects and Get-Member consumes them, reporting the type name once and then every property, method, and property set that type exposes.

  • Export DNS client configuration

    List configured IPv4 DNS servers with Get-DnsClientServerAddress. Pair each interface with its resolver addresses and exclude empty lists.

  • Export IPv4 configuration

    Get-NetIPAddress limited to -AddressFamily IPv4 returns every address bound to every interface.

  • Export OU inventory

    Export Active Directory OUs to CSV with their names, distinguished names, and accidental-deletion protection settings.

  • Export a time-bounded Entra sign-in report

    Review a PowerShell example for exporting recent Microsoft Entra sign-ins. Check access requirements and adapt the query to your reporting task.

  • Find Azure resources missing required tags

    Inspect Azure resource tags with Get-AzResource and identify resources missing required keys before planning any changes.

  • Find Defender exclusions

    Get-MpPreference returns the local Defender configuration, and the projection pulls the three exclusion collections covering file paths, process images, and extensions.

  • Find Hyper-V checkpoints

    Get-VM feeds each guest into Get-VMSnapshot, which returns the checkpoints belonging to that machine.

  • Find USB storage devices

    Query Win32_DiskDrive for USB storage devices. Report model, device ID, size in bytes, and available serial numbers with PowerShell.

  • Find accounts in an unexpected OU

    Every user object is retrieved, then Where-Object keeps the ones whose DistinguishedName fails to match a regular expression describing the approved containers.

  • Find changed PowerShell files in Git

    git diff with --name-only prints paths instead of patch content, and the pathspec arguments after the double dash restrict output to ps1 and psm1 files.

  • Find disabled Entra users

    The -Filter argument hands accountEnabled eq false to Graph as an OData expression so the service performs the selection.

  • Find disconnected adapters

    Use Get-NetAdapter to list interfaces whose status is not Up. Include the interface name, status, and driver description for investigation.

  • Find duplicate SPNs

    Query Active Directory servicePrincipalName values, expand the collections, and group repeated SPNs to investigate duplicate registrations.

  • Find duplicate mail addresses

    Every user is retrieved with the mail attribute, accounts holding no address are dropped, Group-Object buckets the remainder by address, and only buckets with more than one member survive.

  • Find empty directories

    Find empty folders with Get-ChildItem and Where-Object. Count hidden and system entries when deciding whether a directory is empty.

  • Find empty security groups

    Get-ADGroup returns security groups, then ForEach-Object tests each by calling Get-ADGroupMember against it.

  • Find enabled users without email

    Enabled users are retrieved with the mail attribute requested explicitly, and the intent of the middle stage is to keep only accounts where mail holds nothing.

  • Find established endpoints

    Group established TCP connections by remote address, then sort by count to find the endpoints with the most concurrent connections.

  • Find expiring machine certificates

    Find local-machine certificates with an expiry before a 30-day cutoff. Report subject, thumbprint, expiry, and private-key availability.

  • Find external forwarding rules

    Every mailbox is enumerated, and for each one Get-InboxRule is called against its primary SMTP address with errors suppressed so mailboxes that cannot be reached are skipped quietly.

  • Review scheduled tasks with nonzero results

    Get-ScheduledTask enumerates every registered task, and piping it into Get-ScheduledTaskInfo attaches the runtime history to each.

  • Find guest users

    A userType eq 'Guest' filter is evaluated by Graph, with the literal in single quotes because OData string comparisons require them.

  • Rank processes by total CPU time

    Get-Process emits one process object per running executable, Sort-Object orders them by the CPU property in descending order, and -First 15 trims the tail.

  • Find high memory processes

    The pipeline sorts Get-Process output on WorkingSet64, the resident set in bytes as reported by the 64-bit counter, then keeps the top fifteen.

  • Review inactive enabled AD accounts

    A cutoff is calculated ninety days back, then Get-ADUser retrieves enabled accounts and asks for LastLogonDate explicitly because that property is outside the default property set.

  • Find listening TCP ports

    Get-NetTCPConnection with -State Listen returns only sockets sitting in the listening state rather than the full connection table.

  • Find locked-out users

    Search-ADAccount -LockedOut asks the directory for accounts currently in a locked state, so the selection happens server-side with no client filtering involved.

  • Find Windows disks below a free-space threshold

    Query fixed local disks with Get-CimInstance and Win32_LogicalDisk, calculate free space, and identify volumes below the script's threshold.

  • Find mailbox forwarding

    Get-EXOMailbox runs with -PropertySets All so the forwarding attributes come back, since they sit outside the minimal default set this cmdlet returns.

  • Find old VMware snapshots

    Find VMware snapshots older than seven days with Get-Snapshot. Report the VM, snapshot name, creation date, and size in GB.

  • Find old temporary files

    Get-ChildItem walks the current user's temp directory recursively for files only, with -EA SilentlyContinue swallowing the access denials that a deep walk inevitably hits.

  • Find processes outside Windows directories

    Query Win32_Process with Get-CimInstance to inspect executable paths outside C:\Windows, alongside process names and IDs.

  • Review stale AD computer accounts

    Find enabled AD computer accounts with a recorded LastLogonDate older than 120 days. Review the evidence before treating an account as unused.

  • Find stopped Azure VMs

    Filter Azure VM status data for stopped and deallocated machines. Keep the resource group and power state so the two conditions remain distinct.

  • Find stopped automatic services

    Use Get-Service and Where-Object to find automatic-start services that are not running. Return service names and display names for investigation.

  • Find unattached Azure disks

    Get-AzDisk enumerates the managed disks in the subscription and Where-Object keeps those whose DiskState reads Unattached.

  • Report AD accounts with non-expiring passwords

    Get-ADUser filters server-side on PasswordNeverExpires being true and requests the same attribute so the value returns with each object.

  • Find users without a department

    Enabled accounts come back with the Department attribute requested, the middle stage keeps the ones where it is empty, and the output is narrowed to the account name.

  • Find users without a manager

    The query pulls enabled users with the Manager attribute requested, filters down to accounts where that attribute is unpopulated, and reports the account name.

  • Generate a GPO report

    Create an HTML report of domain Group Policy settings with Get-GPOReport -All, including configured settings rather than only GPO names.

  • Build a server health report object

    Combine server health measurements into a structured PowerShell object that can be inspected, filtered or exported.

  • Generate uptime report

    Query Win32_OperatingSystem on each computer and calculate uptime from LastBootUpTime. Check unreachable hosts before using the report.

  • Inspect PowerShell command lines

    A WQL filter restricts Win32_Process to the two PowerShell image names so the selection happens inside the CIM provider rather than in the pipeline.

  • Inventory Azure VMs

    Get-AzVM with -Status queries each machine's instance view in addition to its model, and that is what populates the PowerState property.

  • Inventory Azure resource groups

    Get-AzResourceGroup returns every group in the subscription the context points at, and the projection keeps the group name with its location and provisioning state.

  • Inventory Azure subscriptions

    Get-AzSubscription lists the subscriptions the signed-in identity can see in the current tenant, and the projection keeps name, ID, tenant ID and State.

  • Inventory Entra groups

    Inventory Entra ID groups with Microsoft Graph PowerShell, selecting the group properties needed for a directory report.

  • Inventory Entra users

    Get-MgUser with -All pages through the whole directory instead of stopping at the first page, and -Property maps to the underlying $select so only the four requested properties come back.

  • Inventory GPOs

    Get-GPO -All enumerates every policy object in the domain and the projection keeps the display name with its GUID and both timestamps.

  • Inventory Hyper-V VMs

    List Hyper-V guests with Get-VM and report state, CPU usage, assigned memory in bytes, and status for each virtual machine.

  • Inventory VMware VMs

    Get-VM against a connected vCenter returns the guests, and the projection keeps the name with PowerState, NumCpu, MemoryGB, and the VMHost the guest is running on.

  • Inventory Windows build information

    One Get-CimInstance call against Win32_OperatingSystem returns a single instance per machine.

  • Inventory software from Windows uninstall keys

    Get-ItemProperty reads the uninstall hives directly, covering both the native path and Wow6432Node so 32-bit packages on a 64-bit host are included.

  • Inventory network adapters

    Inventory network interfaces with Get-NetAdapter. Report status, link speed, MAC address, and driver description beside each interface name.

  • Inventory service principals

    List tenant service principals with Microsoft Graph PowerShell. Review application identities and the properties returned by the inventory.

  • Investigate account lockouts

    Query Security event ID 4740 from the last eight hours. Inspect the timestamp, logging computer, and message for account-lockout evidence.

  • Mailbox inventory

    Get-EXOMailbox with -ResultSize Unlimited pages through all recipients rather than stopping at the default first thousand.

  • Mailbox permissions report

    Inspect a mailbox’s access rights and inherited permissions with Get-EXOMailboxPermission before preparing a permissions report.

  • Mailbox size report

    Use Get-EXOMailboxStatistics to report mailbox item counts and total sizes, then sort the results to inspect the largest mailboxes first.

  • Map active TCP connections to processes

    Established connections come back from Get-NetTCPConnection, and ForEach-Object builds a fresh [pscustomobject] per row carrying the local port with the owning process name.

  • Measure endpoint latency

    The loop sends four ICMP probes per target with Test-Connection and pipes the replies into Measure-Object, which computes the average, minimum, and maximum response time.

  • Report Azure role assignments

    Report Azure role assignments with Get-AzRoleAssignment, including principal identity, role, scope, and object type in the active context.

  • Report FSMO role holders

    Find all five FSMO role holders with Get-ADForest and Get-ADDomain. Read the forest-wide and domain-specific role properties separately.

  • Report direct license counts

    Get-MgUser -All requests AssignedLicenses alongside the display name.

  • Report domain controllers

    List AD domain controllers with their sites, IPv4 addresses, operating systems, and global-catalog status using Get-ADDomainController.

  • Report local Administrators members

    Get-LocalGroupMember resolves the group membership and returns each principal with two useful qualifiers.

  • Report scheduled tasks running under stale accounts

    The task inventory is read first, then each configured principal is translated to a SID.

  • Retry a transient remote operation

    Retry Invoke-Command up to three times with increasing delays. Use terminating error handling and rethrow the final failure.

  • Review default routes

    Filtering Get-NetRoute to the destination prefix 0.0.0.0/0 returns only the default routes.

  • Review unsigned PowerShell scripts in a repository

    Check PowerShell script signatures without executing the files. Identify unsigned scripts and review their signature status.

  • Run PSScriptAnalyzer over a repo

    Scan scripts and modules recursively with Invoke-ScriptAnalyzer, then export rule names, severity, and line numbers to CSV for review.

  • Run Pester tests and capture results

    Invoke-Pester executes the test files under the tests directory with normal console output, and -PassThru returns the run object instead of only printing to the console.

  • SharePoint site inventory

    Inventory SharePoint Online site collections with Get-SPOSite -Limit All and inspect the returned site properties.

  • Shared mailbox inventory

    Passing -RecipientTypeDetails SharedMailbox to Get-EXOMailbox filters at the service rather than in the pipeline, and -ResultSize Unlimited keeps the full result set.

  • Summarize computers by OS

    Query AD computer operating systems, group matching values, and sort by count to report how many machine accounts use each OS.

  • Summarize failed logons

    The FilterHashtable pins the Security channel and event ID 4625 with a start time one day back, so the log service performs the selection rather than the pipeline.

  • Teams inventory

    Use Get-Team to report team names, Microsoft 365 group IDs, visibility, and archived status in a PowerShell inventory.

  • Test a TCP port across servers

    The loop walks $Computers and calls Test-NetConnection against each with the port held in $Port, capturing the result object.

  • Trace DNS resolution across configured resolvers

    The script asks each configured IPv4 DNS server directly. That removes the local resolver cache and server-selection ambiguity from the comparison.

  • Transport rule inventory

    Get-TransportRule returns every rule in the organization and the projection keeps the name with State, Mode, Priority, and Description.

  • Use splatting for a CIM query

    A hashtable holds parameter names as keys with their values attached, then @params in place of the individual parameters hands the whole set to Get-CimInstance.

  • Validate a module manifest

    Get-ChildItem finds every psd1 file under the current directory and ForEach-Object runs Test-ModuleManifest against each full path.

  • Check whether recent backup files arrived

    Check a backup folder for files written since an expected timestamp. Report the twenty newest matching names, sizes, and write times.

  • Write a correlation-aware JSON operation log

    Each line is a complete JSON object with an ISO-8601 UTC timestamp and one correlation ID.

  • Write structured audit records

    A [pscustomobject] literal captures the timestamp and host name along with the action, status, and message supplied by the caller.

Troubleshooting26 pages

Error reference15 pages

Knowledge checks13 pages

Interview questions34 pages

Home1 pages