您现在的位置是:网站首页> 编程资料编程资料
PowerShell添加本地账户脚本分享_PowerShell_
2023-05-26
325人已围观
简介 PowerShell添加本地账户脚本分享_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检查网站响应并计算执行时间例子_PowerShell_
- PowerShell中改变F1帮助文档命令获取方式为在线文档的方法_PowerShell_
- PowerShell ISE自动化简单示例_PowerShell_
- Powershell ISE的抽象语法树编程示例_PowerShell_
- 揭秘PowerShell 5.0新特性和新功能_PowerShell_
- 简单谈谈PowerShell 4.0中的新命令_PowerShell_
- PowerShell 3.0管理Hyper-V 3.0_PowerShell_
- Windows 8 中的 PowerShell 3.0_PowerShell_
- PowerShell管理Win Server 2008 R2_PowerShell_
- 浅谈PowerShell 捕获错误_PowerShell_
