WinProfileOps

0.3.0-preview0002

The WinProfileOps module provides a comprehensive toolkit for managing Windows user profiles across local and remote computers. This module automates profile management tasks such as detecting orphaned profiles, retrieving profile information, and auditing discrepancies between profile data in the file system and the registry. It handles both filesystem and registry o
The WinProfileOps module provides a comprehensive toolkit for managing Windows user profiles across local and remote computers. This module automates profile management tasks such as detecting orphaned profiles, retrieving profile information, and auditing discrepancies between profile data in the file system and the registry. It handles both filesystem and registry operations, leveraging its dependency on WinRegOps for registry-related tasks.

WinProfileOps integrates seamlessly with WinRegOps to query, validate, and manage user profile-related data from the Windows registry. This module is ideal for system administrators seeking to streamline profile management, especially in environments with many users and computers.

Dependencies:
- WinRegOps: WinProfileOps depends on WinRegOps for registry operations, such as querying, opening, and modifying registry keys related to user profiles.

Key features:
- Retrieve user profile information from both the registry and file system (local and remote).
- Detect orphaned profiles (e.g., missing profile folders or registry entries).
- Filter and exclude special accounts like system or service accounts.
- Remote profile management support for retrieving profiles from different systems.
- Robust error handling for permission issues or unreachable systems.
- Class-based profile objects for easy integration with automation tasks or scripts.

Typical use cases include:
- Cleaning up orphaned profiles after system migrations or user deactivations.
- Automating stale profile detection on local and remote systems to maintain system performance.
- Managing user profiles in large-scale, multi-user environments such as terminal servers and Citrix.
- Excluding critical system accounts from profile management tasks, ensuring important profiles remain unaffected.
- Providing profile management as part of system maintenance routines to enhance system health.

Upcoming Features:
- The `Remove-UserProfile` function is coming soon, offering safe removal of user profiles from both the file system and registry, with strong safeguards like `ShouldProcess`, `-WhatIf`, and `-Confirm` to prevent accidental deletions.
Show more

Minimum PowerShell version

5.1

This is a prerelease version of WinProfileOps.
There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

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

Install-Module -Name WinProfileOps -RequiredVersion 0.3.0-preview0002 -AllowPrerelease

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

Install-PSResource -Name WinProfileOps -Version 0.3.0-preview0002 -Prerelease

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) 2024 LarryWisherMan. All rights reserved.

Package Details

Author(s)

  • LarryWisherMan

Tags

WindowsProfiles ProfileManagement OrphanedProfiles RegistryOperations FilesystemOperations RemoteManagement UserProfiles ProfileCleanup WindowsRegistry SystemAdministration Automation ProfileValidation WindowsManagement ITAdministration UserProfileTools

Functions

Get-OrphanedProfiles Get-UserProfilesFromFolders Get-UserProfilesFromRegistry Invoke-UserProfileAudit

Dependencies

Release Notes

## [0.3.0-preview0002] - 2024-09-16

### Added

- New helper function `Validate-SIDFormat` to verify SID value upon retrieval
in `Get-ProfilePathFromSID`

- **Admin Detection and Environment Variable**: Added logic to detect whether the
current user is an administrator and set an environment variable
 `WinProfileOps_IsAdmin` accordingly.

 - If the user is an administrator, `$ENV:WinProfileOps_IsAdmin` is set to
  `$true`. If not, it's set to `$false`.

 - The environment variable is automatically removed when the module is
  unloaded or when PowerShell exits.

 - Registered an `OnRemove` script block and a `PowerShell.Exiting` event to
  ensure cleanup of the environment variable on module removal or session exit.

- **Get-SIDProfileInfoFallback**: Introduced a new fallback function
  `Get-SIDProfileInfoFallback` that retrieves non-special user profile
   information using the CIM/WMI method.

### Changed

- **Get-UserProfilesFromRegistry**: Updated the function to handle scenarios
where the current user does not have administrative privileges.

 - The function now checks if the user is an administrator by evaluating the
  `WinProfileOps_IsAdmin` environment variable.

 - If the user has administrator privileges, the function retrieves user
  profiles from the registry using `Get-SIDProfileInfo`.

 - If the user lacks administrative privileges, the function falls back to the
  `Get-SIDProfileInfoFallback` method, which retrieves user profiles using
   CIM/WMI without requiring registry access.

 - A warning is logged when the fallback method is used, indicating that
  special system accounts are excluded.

- Refactored `Process-RegistryProfiles` to better account for access denied errors
when testing profile paths with `Test-FolderExists`

- Updated `UserProfile` object creation in `Test-OrphanedProfile` for
`$AccessError` Scenarios

- Module is now using `WinRegOps` Version `0.4.0` for more refined registry value
retrieval

FileList

Version History

Version Downloads Last updated
0.3.0-previe... 5 10/1/2024
0.3.0-previe... 4 10/1/2024
0.3.0-previe... 3 10/1/2024
0.3.0-previe... 4 9/24/2024
0.3.0-previe... 3 9/24/2024
0.3.0-previe... (current version) 3 9/16/2024
0.3.0-previe... 4 9/12/2024
0.2.0 16 9/12/2024
0.2.0-previe... 2 9/12/2024
0.2.0-previe... 2 9/11/2024
0.2.0-previe... 3 9/9/2024
Show less