手机
当前位置:查字典教程网 >脚本专栏 >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脚本trap语句捕获异常写法实例

PowerShell脚本写的文件.ps1文件介绍

PowerShell中获取Windows系统序列号的脚本分享

Powershell实现从注册表获取本地关联文件的扩展名

PowerShell脚本开发之尝试登录ftp

Powershell小技巧之查询AD用户

Windows Powershell 执行文件和脚本

PowerShell入门教程之编写和使用脚本模块实例

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

精品推荐
分类导航