zoukankan      html  css  js  c++  java
  • 域账号相关的脚本

    解锁账号:
    Search-ADAccount -SearchBase 'OU=USERS,OU=RESTRICTED,OU=CHINA,DC=tcsgegdc,DC=com' -LockedOut | Unlock-ADAccount
    
    重置密码:
    $user = Read-Host -Prompt "请输入员工号"
    $pwd = ConvertTo-SecureString '密码' -AsPlainText -Force
    Set-ADAccountPassword -Identity $user -Reset -NewPassword $pwd
    Unlock-ADAccount -Identity $user
    
    新建用户:
    $input = Read-Host -Prompt "名 姓 员工号"
    $detail = $input.Split(" ")
    $displayname = $detail[0] + ' ' + $detail[1]
    $upn = $detail[2] + '@tcsgegdc.com'
    $pwd = ConvertTo-SecureString '密码' -AsPlainText -Force
    New-ADUser -Server tcsgechidc02 -AccountPassword $pwd -Enabled $true -Name $detail[2] -Path 'OU=USERS,OU=RESTRICTED,OU=CHINA,DC=tcsgegdc,DC=com' -GivenName $detail[0] -Surname $detail[1] -DisplayName $displayname -SamAccountName $detail[2] -UserPrincipalName $upn
    
    删除用户:
    $user = Read-Host -Prompt "请输入员工号"
    Remove-ADUser -Server tcsgechidc02 -Identity $user
    Show-EventLog -ComputerName tcsgechidc02
  • 相关阅读:
    Network in Network
    cord-in-a-box 2.0 安装指南
    L2 约束的最小二乘学习法
    点估计
    递归简介
    向量的L2范数求导
    优雅的线性代数系列三
    ansible批量部署nginx
    ansible批量部署mysql
    ansible批量部署tomcat
  • 原文地址:https://www.cnblogs.com/IvanChen/p/4487704.html
Copyright © 2011-2022 走看看