added new script

This commit is contained in:
poslop
2025-02-10 13:02:54 -06:00
parent dac4075676
commit 61f0560365
2 changed files with 45 additions and 2 deletions

View File

@@ -10,10 +10,10 @@ $inactiveDate = (Get-Date).AddDays(-$daysInactive)
$profiles = Get-WmiObject Win32_UserProfile
# Get all user profiles
:Loop ForEach-Object ($profile in $profiles) {
:Loop foreach ($profile in $profiles) {
$userFolder = $profile.LocalPath
$userName = $profile.LocalPath.Split('\')[-1] # Get the username from the folder path
$nameIsExcluded = false
$nameIsExcluded = $false
foreach ($name in $excludedProfiles) {
if ($item -eq $userName) {