手机
当前位置:查字典教程网 >脚本专栏 >PowerShell >PowerShell添加本地账户脚本分享
PowerShell添加本地账户脚本分享
摘要:脚本源码:复制代码代码如下:$nt=[adsi]"WinNT://localhost"$user=$nt.create("user","te...

脚本源码:

复制代码 代码如下:

$nt=[adsi]"WinNT://localhost"

$user=$nt.create("user","test")

$user.setpassword("password")

$user.setinfo()

Get-WmiObject -Class Win32_UserAccount -Filter "name = 'test'" | Set-WmiInstance -Argument @{PasswordExpires = 0}

$group=[ADSI]"WinNT://localhost/administrators,group"

$group.add("WinNT://localhost/test")

【PowerShell添加本地账户脚本分享】相关文章:

PowerShell判断某天是星期几的方法

PowerShell ISE自动化简单示例

Powershell小技巧之获取MAC地址

PowerShell脚本开发之批量扫描IP和端口

PowerShell脚本实现检测网络内主机类型

Powershell打印文本文档例子

PowerShell脚本trap语句捕获异常写法实例

探索PowerShell(六) 脚本基础简要

Powershell脚本中包含文件资源的例子

Powershell批量给文件增加前辍实例

精品推荐
分类导航