PowerShell添加本地账户脚本分享
更新时间:2015年03月25日 09:21:58 投稿:junjie
这篇文章主要介绍了PowerShell添加本地账户脚本分享,本文直接给出实现代码,需要的朋友可以参考下
脚本源码:
复制代码 代码如下:
$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使用OpenFileDialog打开文件示例
这篇文章主要介绍了Powershell使用OpenFileDialog打开文件示例,本文直接给出示例代码,需要的朋友可以参考下2015-03-03PowerShell小技巧之获取TCP响应(类Telnet)
这篇文章主要介绍了使用PowerShell获取TCP响应(类Telnet)的小技巧,需要的朋友可以参考下2014-10-10
最新评论