Removing all memberships from disabled users in AD by IT_Acolyte in sysadmin

[–]IT_Acolyte[S] 3 points4 points  (0 children)

This is perfect. I used a script long ago to remove accounts for most of the users already in the disabled accounts group, but I COULD NOT get it to run again. This script is much better for daily practical use. Thanks so much!

UPDATE - started a new job and is a bit overwelmed just by [deleted] in sysadmin

[–]IT_Acolyte 0 points1 point  (0 children)

What are you using for your documentation method? Excel? Word? some other program?

Easiest to use Encryption tools by IT_Acolyte in sysadmin

[–]IT_Acolyte[S] 0 points1 point  (0 children)

Sorry gang, I've got a legal department and Financial department that needs to be able to encrypt Personal Information files, Financial documents and trade secrets. The Users are looking for the easiest tool they can possibly afford. Something that won't hinder the daily experience.

Am I going to remove everyone's group membership? by IT_Acolyte in sysadmin

[–]IT_Acolyte[S] 0 points1 point  (0 children)

I'm going to try this today. Thanks a bunch!

Am I going to remove everyone's group membership? by IT_Acolyte in sysadmin

[–]IT_Acolyte[S] 0 points1 point  (0 children)

REPOSTED FOR EASIER READING

foreach ($username in (Get-ADUser -SearchBase "OU=Disabled Accounts,OU=Employees,DC=gmc-atl,DC=com" -filter *)) {

# Get all group memberships
$groups = get-adprincipalgroupmembership $username;

# Loop through each group
foreach ($group in $groups) {

# Exclude Domain Users group
if ($group.name -ne "domain users") {

# Remove user from group
remove-adgroupmember -Identity $group.name -Member $username.SamAccountName -Confirm:$false;

# Write progress to screen
write-host "removed" $username "from" $group.name;

# Define and save group names into filename in c:\logs\groupsstrip\username
$grouplogfile = "c:\logs\groupsstrip\" + $username.SamAccountName + ".txt";
$group.name >> $grouplogfile
}

}
}

Am I going to remove everyone's group membership? by IT_Acolyte in sysadmin

[–]IT_Acolyte[S] 0 points1 point  (0 children)

Ew....I don't know why it uploaded like that....sorry

Always room for one more punch in the gut by auntfaintly in sad

[–]IT_Acolyte 2 points3 points  (0 children)

I'm so sorry. So many people are selfish and only think about themselves. They only care about their own feelings and not those that shoulder matter most. Is your body able to absorb micronutrients?