"""Reset password for office@lonestarelectrical.net - attempt 2, no force change"""
from google.oauth2 import service_account
from googleapiclient.discovery import build

SCOPES = ['https://www.googleapis.com/auth/admin.directory.user']

creds = service_account.Credentials.from_service_account_file(
    'temp/acg-msp-access-8f72339997e5.json', scopes=SCOPES
)
delegated = creds.with_subject('sysadmin@lonestarelectrical.net')
service = build('admin', 'directory_v1', credentials=delegated)

user_email = 'office@lonestarelectrical.net'
new_pass = 'LoneStar2026!!'

service.users().update(
    userKey=user_email,
    body={
        'password': new_pass,
        'changePasswordAtNextLogin': False,
    }
).execute()

print(f"[OK] Password reset for {user_email}")
print(f"Password: {new_pass}")
