added new script
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user