zoukankan      html  css  js  c++  java
  • 关于server的一些小记

    一、

    批量创建用户
    1. Import-Module ActiveDirectory
    2. import-csv e:users ewusers.csv |
    3. New-ADUser -path "ou=test1,dc=contoso,dc=com" -passthru |
    4. ForEach-Object {
    5.    $_ | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Pa$$w0rd" -Force)
    6.    $_ | Enable-ADAccount }


    二、
    import-csv Accounts.csv | Foreach {New-ADUser -Name $_.Name -Enabled $true - AccountPassword (ConvertTo-SecureString $_.Password -AsPlainText -force)}

    Run the Set-ADServiceAccount cmdlet.设置服务账户

    三、
      Sample AD PowerShell command to update UPNs in bulk:(修改upn需要使用域和信任关系)
    Get-ADUser-Filter * -properties homemdb | where {$_.homemdb -ne $null} | ForEach-Object ($_.SamAccountName) {$CompleteUPN = $_.SamAccountName + "@contoso.com"; Set-ADUser -Identity $_.DistinguishedName -UserPrincipalName $CompleteUPN}

    四、
    Set-ADObject
    Modifies an Active Directory object.

    Parameter
    -ProtectedFromAccidentalDeletion <Boolean>
    Specifies whether to prevent the object from being deleted. When this property is set to true, you cannot delete the corresponding object without changing the value of the property. Possible values for this parameter include:

    $false or 0
    $true or 1

    五、
    dsquery user domainroot -desc "Temp" | dsmod user -disabled yes 查询账户并修改属性

    六、
    Set-ADForest -UPNSuffixes @{Add="headquarters.fabrikam.com"} 添加upn后缀

    七、
    CSVDE -f onlyusers.csv -r "objectCategory=person" -l "CN,<CustomAttributeName>"  查看所有用户属性导出为excel文件

    八、颗粒化密码策略——————————图解说明

    1、设置名称

    1-设置名称

    2、设置策略优先级

    2-密码设置优先级

    3、用可还原的加密来存储

    3-用可还原的加密来存储密码

    4、强制密码历史

    4- 强制密码历史

    5、密码复杂性要求

    5-密码复杂性要求

    6、密码最小长度

    6-密码最小长度

    7、密码使用最小期限

    7-密码最小使用期限

    8、密码最长使用期限

    8-密码最长使用期限

    9、登陆锁定阈值

    9-锁定阈值(几次登陆无效)

    10、重置账户锁定计数器

    10-重置账户锁定计数器

    11、锁定时间

    11-锁定时间

  • 相关阅读:
    html5-css渐变色
    html5-css综合练习
    html5-css背景
    html5-css边框全
    html5-css边框img
    进程控制(二)与linux下的自有服务
    进程检测与控制(一)
    权限及软件包管理
    linux下文件权限管理
    vim及用户组管理
  • 原文地址:https://www.cnblogs.com/ywj2013/p/3361349.html
Copyright © 2011-2022 走看看