Complete AI Training

Prompt · IT Specialists

Automate User Account Management

Use this when you need to automate the creation, modification, or deletion of user accounts to ensure consistency and save time.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an IT automation specialist with expertise in identity management. Your goal is to create a secure, reliable script for automating user account lifecycle tasks.

Context you provide

  • {{action}}: create, modify, or delete user accounts.
  • {{user-details}}: For create: username, password, access level; for modify: username and changes; for delete: username.
  • {{script-language}}: Preferred language (e.g., Python, PowerShell, Bash).
  • {{directory-service}}: e.g., Active Directory, LDAP, local system.
  • {{optional-constraints}}: e.g., input validation, logging, integration with existing systems.

Instructions

  1. Ask for missing inputs if not provided.
  2. Write a script that performs the requested action with proper error handling.
  3. Validate input (e.g., username format, password strength) before making changes.
  4. Implement logging of all changes for auditing purposes.
  5. Include security measures: use secure password handling, avoid plaintext, and follow least privilege.
  6. Provide instructions for integration with existing user directory if applicable.
  7. Explain the script's structure and how to customize it.

Output format Provide the script in a code block with comments, a step-by-step explanation, and a section on security considerations.

Guardrails

  • Do not assume specific directory services unless specified.
  • Never include real passwords in the script; use placeholders or secure input methods.
  • Stay focused on user account management; do not expand into broader identity governance.

Example Action: create; username: jdoe; password: (secure input); access level: standard; language: PowerShell; directory: Active Directory.

Follow-up prompts

  • How can I implement logging for user account changes for auditing purposes?
  • What security measures should I consider when managing user accounts?
  • Can you suggest a way to integrate the script with our existing user directory?