{"id":15130606,"url":"https://github.com/larrywisherman/winprofileops","last_synced_at":"2025-10-23T07:30:29.475Z","repository":{"id":255846458,"uuid":"853628155","full_name":"LarryWisherMan/WinProfileOps","owner":"LarryWisherMan","description":"PowerShell module for managing Windows user profiles, including detection and removal of orphaned profiles, registry operations, and remote management support.","archived":false,"fork":false,"pushed_at":"2024-10-01T19:27:04.000Z","size":360,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T20:15:39.196Z","etag":null,"topics":["automation","powershell","registry","userprofiles","windows"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/WinProfileOps/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LarryWisherMan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-07T04:33:15.000Z","updated_at":"2024-12-27T08:25:40.000Z","dependencies_parsed_at":"2024-10-09T17:00:44.687Z","dependency_job_id":null,"html_url":"https://github.com/LarryWisherMan/WinProfileOps","commit_stats":null,"previous_names":["larrywisherman/winprofileops"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LarryWisherMan%2FWinProfileOps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LarryWisherMan%2FWinProfileOps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LarryWisherMan%2FWinProfileOps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LarryWisherMan%2FWinProfileOps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LarryWisherMan","download_url":"https://codeload.github.com/LarryWisherMan/WinProfileOps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237793848,"owners_count":19367421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","powershell","registry","userprofiles","windows"],"created_at":"2024-09-26T03:02:57.513Z","updated_at":"2025-10-23T07:30:29.037Z","avatar_url":"https://github.com/LarryWisherMan.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WinProfileOps\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/LarryWisherMan/ModuleIcons/main/WinProfileOps.png\"\n       alt=\"WinProfileOps Icon\" width=\"400\" /\u003e\n\u003c/p\u003e\n\nThe **WinProfileOps** module provides a robust toolkit for managing Windows user\nprofiles on both local and remote computers. This module simplifies and automates\ncomplex profile management tasks, such as detecting orphaned profiles, validating\nprofile paths, and identifying stale or corrupted profiles. It handles both filesystem\nand registry operations, utilizing the **WinRegOps** module for registry-related\nfunctions.\n\n**WinProfileOps** seamlessly integrates with **WinRegOps** to manage profiles by\nquerying, validating, and auditing user profile-related data from the Windows\nregistry. This module is ideal for system administrators who want to streamline\nprofile management operations, especially in environments with numerous users and\ncomputers.\n\n---\n\n## Dependencies\n\n- **WinRegOps**: The **WinProfileOps** module depends on\n  [**WinRegOps**](https://github.com/LarryWisherMan/WinRegOps) for registry\n  operations such as querying, opening, and modifying registry keys related to user\n  profiles.\n\n---\n\n## Key Features\n\n- **Retrieve user profile information** from both the registry and the file system\n  (local and remote).\n\n- **Detect orphaned profiles**, such as profiles missing from the file system or\n  registry.\n\n- **Filter and exclude special accounts** like system or service accounts (e.g.,\n  `defaultuser0`, `S-1-5-18`).\n\n- **Remote profile management** with support for handling user profiles across\n  different systems.\n\n- **Error handling** for permission issues, unreachable systems, and missing data.\n\n- **Class-based profile objects** for easy integration with other automation tasks\n  or scripts.\n\n---\n\n## Typical Use Cases\n\n- **Cleaning up orphaned profiles** after system migrations,\nuser deactivations, or profile corruption.\n\n- **Managing user profiles in large-scale environments**, such as terminal servers,\n  Citrix environments, or multi-user systems.\n\n- **Excluding system accounts** from profile cleanup operations to prevent accidental\n  deletion of important system profiles.\n\n- **System maintenance routines** that include profile validation\n and management as part of a broader system health check.\n\n---\n\n## Installation\n\nYou have two options to install **WinProfileOps**:\n\n1. **Install from PowerShell Gallery**  \n   You can install the module directly from the \n   [PowerShell Gallery](https://www.powershellgallery.com/packages/WinProfileOps)\n   using the `Install-Module` command:\n\n   ```powershell\n   Install-Module -Name WinProfileOps\n   ```\n\n1. **Install from GitHub Releases**  \n   You can also download the latest release from the \n   [GitHub Releases page](https://github.com/LarryWisherMan/WinProfileOps/releases).\n   Download the `.zip` file, extract it, and place it in one of your `$PSModulePath`\n   directories.\n\n---\n\n## Usage\n\n#### Example 1: Detecting Orphaned Profiles\n\nUse the `Get-OrphanedProfiles` function to detect orphaned profiles on a local or\nremote machine:\n\n```powershell\n$orphanedProfiles = Get-OrphanedProfiles -ComputerName \"RemotePC\" -IgnoreSpecial\n```\n\nThis retrieves all orphaned profiles on `RemotePC`, excluding special accounts.\n\n#### Example 2: Retrieving User Profiles from the File System\n\nUse the `Get-UserProfilesFromFolders` function to retrieve user profile folders from\nthe file system on a local or remote machine:\n\n```powershell\n$userFolders = Get-UserProfilesFromFolders -ComputerName \"Server01\"\n```\n\nThis retrieves user profile folders from the default `C:\\Users` directory on `Server01`.\n\n#### Example 3: Retrieving User Profiles from the Registry\n\nUse the `Get-UserProfilesFromRegistry` function to query user profiles from the\nWindows registry:\n\n```powershell\n$registryProfiles = Get-UserProfilesFromRegistry -ComputerName \"LocalHost\"\n```\n\nThis retrieves user profiles from the registry on `LocalHost`.\n\n#### Example 4: Auditing User Profiles\n\nUse the `Invoke-UserProfileAudit` function to audit profiles across the file\n system and\nregistry:\n\n```powershell\n$allProfiles = Invoke-UserProfileAudit -ComputerName \"Server01\"\n```\n\nThis audits user profiles on `Server01`, returning both file system and registry\nprofile information.\n\n#### Example 5: Removing User Profiles from the Registry\n\nUse the `Remove-UserProfilesFromRegistry` function to remove user profiles from\n the Windows registry based on SIDs, Usernames, or UserProfile objects:\n\n- Remove profiles by SIDs:\n\n  ```powershell\n  Remove-UserProfilesFromRegistry -SIDs \"S-1-5-21-1234567890-1\", \"S-1-5-21-1234567890-2\"\n  ```\n\n- Remove profiles by usernames on a remote computer:\n\n  ```powershell\n  Remove-UserProfilesFromRegistry -Usernames \"john.doe\", \"jane.smith\"\n  -ComputerName \"Server01\" -Force -Confirm:$false\n  ```\n\n- Audit user profiles before removal:\n\n  ```powershell\n  Remove-UserProfilesFromRegistry -UserProfiles $userProfileList -AuditOnly\n  ```\n\n**Note:** To bypass any confirmation prompts during profile removal, both the\n `-Force` switch and `-Confirm:$false` must be specified.\n  \nThis allows you to either remove or audit profiles based on their SIDs,\nusernames, or UserProfile objects.\n\n---\n\n## Key Functions\n\n- **`Get-OrphanedProfiles`**: Detects orphaned profiles by checking both the\n  registry and file system.\n- **`Invoke-UserProfileAudit`**: Audits and compares profiles from both the registry\n  and file system, identifying discrepancies such as orphaned profiles.\n- **`Get-UserProfilesFromRegistry`**: Retrieves user profiles from the Windows\n  registry.\n- **`Get-UserProfilesFromFolders`**: Retrieves user profile folders from the file\n  system.\n- **`Remove-UserProfilesFromRegistry`**: Removes user profiles from the Windows\nregistry based on SIDs, Usernames, or UserProfile objects,\n with options for audit-only mode or forced removal.\n\n---\n\n## Environment Variables\n\nThe **WinProfileOps** module uses several environment variables to configure\ncertain default paths and behaviors. These variables are automatically set\nwhen the module is loaded and can be adjusted as needed:\n\n- **`$env:WinProfileOps_IsAdmin`**: Determines if the current user has\nadministrative privileges. It is determined by the current context of the\nuser.\n  \n- **`$env:WinProfileOps_RegistryPath`**: Specifies the registry path used for\n managing user profiles. Default value: `\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\"`.\n\n- **`$env:WinProfileOps_RegistryHive`**: Defines the registry hive used in\n operations, set to `LocalMachine` by default.\n\n- **`$env:WinProfileOps_RegBackUpDirectory`**: Specifies the directory where\n registry backups are stored. Default value: `\"C:\\LHStuff\\RegBackUp\"`.\n\n- **`$env:WinProfileOps_ProfileFolderPath`**: The profile folder path, defaulting\n to `\"C:\\Users\"`, but can be customized based on the system's configuration.\n\nThese variables are set automatically when the module is imported and are cleared\n when the module is unloaded or the PowerShell session ends.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarrywisherman%2Fwinprofileops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarrywisherman%2Fwinprofileops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarrywisherman%2Fwinprofileops/lists"}