Git Product home page Git Product logo

disable-inactive-users-active-directory's Introduction

Automatically Disabling Inactive User Accounts in Active Directory

I present a script in the Windows PowerShell scripting language that will allow you to disable user accounts that have been inactive for a certain number of days and add a description with the date when the disconnect was performed. Disabled user accounts will be transferred to the appropriate organizational unit, and a log file will be created with a list of disabled user accounts.

You need to open the script in a text editor or Windows PowerShell ISE and change several values so that the script runs correctly in your organization.

  • In the variable “LogFolder”, you must specify the path to the folder where the log files will be created. These files will contain a list of disabled user accounts.
  • In the “OU” variable, you must specify the path to the organizational unit where your organization's user accounts are stored.
  • In the “InactiveUserOU” variable, you must specify the path to the organizational unit where disabled user accounts in your organization will be transferred.
  • In the variable “UnusedDays”, specify the days after inactive user accounts are disabled.

Automate script execution through the task scheduler. To do this, you need to create a service account under which the task will be launched and also delegate to this account the necessary permissions to the organizational unit where user accounts are stored.

Author

I’m Vladimir Mikhalev, the Docker Captain, but my friends can call me Valdemar.

🌐 My website with detailed IT guides
🎬 Follow me on YouTube
🐦 Follow me on Twitter
🎨 Follow me on Instagram
🧵 Follow me on Threads
🐘 Follow me on Mastodon
🧊 Follow me on Bluesky
🎸 Follow me on Facebook
🎥 Follow me on TikTok
💻 Follow me on LinkedIn
🐈 Follow me on GitHub

Communication

👾 Chat with IT pros on Discord
📧 Reach me at [email protected]

Give Thanks

💎 Support on GitHub
🏆 Support on Patreon
🥤 Support on BuyMeaCoffee
🍪 Support on Ko-fi
💖 Support on PayPal

disable-inactive-users-active-directory's People

Contributors

heyvaldemar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.