Trouble re-adding removed mobile accountsSolved

Participant
Discussion
3 months ago

Hey, I’m working on a script to clean up some of our employees’ mobile accounts from our AD-bound machines. The machines are set to create mobile accounts at login with no confirmation, and all our employee usernames have a “.” in them (like Mathew.Cooper). Here’s what I’ve got so far:

It works for removing the accounts, but after rebooting, I can’t seem to add them back from the login screen. This could be a big problem if the employees can’t use their computers. Any ideas on what’s going wrong? Or maybe there’s a smarter way to handle this?

Replies (2)

Marked SolutionPending Review
Participant
3 months ago
Marked SolutionPending Review

Hey @josiah! Have you tried modifying the script to check if it’s removing any critical files or accounts that might be needed for re-login? Sometimes just a small tweak can make a big difference.

Marked SolutionPending Review
Participant
3 months ago
Marked SolutionPending Review

Hi @josiah , @desmond is correct. Sometimes when accounts are removed too broadly, certain system settings or files that facilitate account re-adding during login might also get wiped out. Here’s a script that could help:

This should do the trick, though it might take a bit longer if you’ve got lots of users.