一、

批量创建用户
1. Import-Module ActiveDirectory
2. import-csv e:\users\newusers.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、设置名称

2、设置策略优先级

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

4、强制密码历史

5、密码复杂性要求

6、密码最小长度

7、密码使用最小期限

8、密码最长使用期限

9、登陆锁定阈值

10、重置账户锁定计数器

11、锁定时间

关于server的一些小记的更多相关文章

  1. Ubuntu server搭建vsftpd小记

    Ubuntu server中搭建vsftpd小记 <h1> 在Ubuntu server中安装vsftpd</h1> sudo apt-get install vsftpd & ...

  2. IIS7 IIS7.5 IIS8.5 HTTP 错误 500.19 – Internal Server Error解决方案小记

    今天配置IIS(win8.1 IIS8.5)的web.config出现如下错误: HTTP 错误 500.19 – Internal Server Error无法访问请求的页面,因为该页的相关配置数据 ...

  3. SQL SERVER触发器游标小记

    今天接到个需求用触发器来实现通过条件对其他表的更新.好久没摸SQL SERVER,电脑里也没SQL SERVER安装包,同事遂发来个安装包,一看吓一跳,3.6G!!!!经过漫长等待后,开始作业.需求如 ...

  4. SQL Server 2014 安装小记

    一.写在前面 由于想体验下微软的Windows Azure在SQL Server数据库方面的使用,笔者花了点时间安装了一下SQL Server 2014,安装很简单,基本就是稍微做些配置即可,笔者在此 ...

  5. sql server 小记——分区表(上)

    我们知道很多事情都存在一个分治的思想,同样的道理我们也可以用到数据表上,当一个表很大很大的时候,我们就会想到将表拆 分成很多小表,查询的时候就到各个小表去查,最后进行汇总返回给调用方来加速我们的查询速 ...

  6. 小记sql server临时表与表变量的区别

    临时表与表变量都可以起到“临时”的作用,那么两者主要的区别是什么呢? 这里不讨论创建方式,以及全局临时表.会话临时表这些,主要记录一下个人对两者的主要区别以及适用情况的看法,有什么不对或补充的地方,欢 ...

  7. 完整成功配置wamp server小记

    首先安装最新版本的wamp server,这是必须的! 配置默认”www目录”的路径(可选):下面以改为D:\site为例.打开wamp\scripts\config.inc.php第47行,$www ...

  8. sql server 小记——分区表

    我们知道很多事情都存在一个分治的思想,同样的道理我们也可以用到数据表上,当一个表很大很大的时候,我们就会想到将表拆 分成很多小表,查询的时候就到各个小表去查,最后进行汇总返回给调用方来加速我们的查询速 ...

  9. server——小记

    问题 Step 1   Start the server in Directory Services Restore Mode   Windows Server 2003/2008 Directory ...

随机推荐

  1. ajax开发框架和XMLhttpRequest、responseText、responseXml和JSON的应用

    1 AJAX开发框架 2 A 初始化XMLHttpRequest对象 3 B指定响应处理函数 4 C发出HTTP请求 5 D处理服务器返回的信息 6 数据格式提要 6 优点 6 缺点 7 解析 JSO ...

  2. [Angular 2] Style Angular 2 Components

    Each Angular 2 Component can have its own styles which will remained contained inside the component. ...

  3. iOS开发——UI篇Swift篇&玩转UItableView(三)分组功能

    UItableView分组功能 class UITableViewControllerGroup: UIViewController, UITableViewDataSource, UITableVi ...

  4. 【Python】 做一个简单的 http server

    # coding=utf-8 ''' Created on 2014年6月15日 @author: Yang ''' import socket import datetime # 初始化socket ...

  5. UVA11038- How Many O&#39;s?(组合数学)

    题目链接 题意:求出在a到b之间的数中,有多少个0. 思路:组合数学问题.能够枚举每一个位置上的数i,如果i之前的数为left,后面的为right,后面有num位数.当i != 0时,将i置为0,所以 ...

  6. 你真的了解javascript吗

    原文地址:http://dmitry.baranovskiy.com/post/91403200 看了文章中五个小例子,写了写自己的理解 #demo1 if (!("a" in w ...

  7. postgrel 调试

    http://blog.csdn.net/anzelin_ruc/article/details/8539411

  8. 引入第三方库错误Undefined symbols for architecture i386: _OBJC_CLASS_$的解决方案

    引起标题上所导致的错误是因为你的第三方库没有放入到Compile Sources里面去. 需要到你项目的Targets>>Build Phases>>Compile Sourc ...

  9. UBIFS FAQ and HOWTO

    转:http://www.linux-mtd.infradead.org/faq/ubifs.html UBIFS FAQ and HOWTO Table of contents How do I e ...

  10. Fragment+FragmentTabHost组件实现常见主页面(仿微信新浪)

    采取的方法是Fragment+FragmentTabHost组件来实现这种常见的app主页面的效果 首先给出main.xml文件 <?xml version="1.0" en ...