# glued2/local-admin architecture

> Architecture diagram of the GitHub repository glued2/local-admin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/glued2/local-admin
- Repository: https://github.com/glued2/local-admin

## Overview

##### Project type and purpose
- This is an open-source administrative tool composed of a single PowerShell script (`localadmin.ps1`) designed to manage and audit local-admin privileges on developer laptops in a hybrid AD/GPO environment.

##### File structure
- Top-level files only:
- `localadmin.ps1` – the core script that runs on each endpoint.
- `README.md` – explains use case (hybrid identity, central management).
- `localadmin.ps1` is deployed via GPO or another endpoint-management mechanism.

##### README for additional insights
- Central goals: grant developers local-admin rights on their laptops based on AD Group membership and device-owner metadata, all under central audit/control.
- Uses a mix of Group Policy for distribution, AD groups for role definition, and device properties (owner) to drive logic.

##### Key elements to capture
- The GPO (or deployment tool) pushing the script
- The script’s decision logic against AD groups and device-owner attribute
- The local Administrators group modification
- The audit event creation and forwarding pipeline
- The IT Admin role managing AD groups and reviewing logs

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Project Repository"
        direction TB
        README["README.md"]:::external
        LICENSE["LICENSE"]:::external
        SCRIPTRepo["localadmin.ps1"]:::script
    end

    subgraph "On-Premise Environment"
        direction TB
        GPO["GPO / Deployment Mechanism"]:::onprem
        Workstation["Developer Workstation"]:::onprem
        AD["Active Directory / Azure AD"]:::onprem
    end

    subgraph "Local Enforcement & Audit"
        direction TB
        LocalAdmins["Local Administrators Group"]:::onprem
        EventLog["Windows Event Log"]:::logging
        Forwarder["Log Forwarder (Winlogbeat)"]:::logging
    end

    subgraph "Central Logging & Operations"
        direction TB
        SIEM["SIEM / Central Log Repo"]:::logging
        ITConsole["IT Admin Operations Console"]:::external
    end

    SCRIPTRepo -->|"Deployed via GPO"| GPO
    GPO -->|"/localadmin.ps1"| Workstation
    Workstation -->|"Executes script"| SCRIPTExec["localadmin.ps1"]:::script
    SCRIPTExec -->|"LDAP/Graph API Query"| AD
    SCRIPTExec -->|"Add-LocalGroupMember"| LocalAdmins
    SCRIPTExec -->|"Write-EventLog"| EventLog
    EventLog -->|"Forward logs"| Forwarder
    Forwarder -->|"Ship events"| SIEM
    SIEM -->|"Viewed by"| ITConsole
    ITConsole -->|"Manage AD Groups"| AD

    click SCRIPTRepo "https://github.com/glued2/local-admin/blob/main/localadmin.ps1"
    click README "https://github.com/glued2/local-admin/blob/main/README.md"
    click LICENSE "https://github.com/glued2/local-admin/tree/main/LICENSE"
    
    classDef onprem fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef script fill:#90EE90,stroke:#000,stroke-width:1px
    classDef logging fill:#FFA500,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
