手机
当前位置:查字典教程网 >脚本专栏 >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数组的一些操作技巧

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

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

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

PowerShell入门教程之函数、脚本、作用域介绍

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

Powershell小技巧之找出最大最小值

Powershell使用WPF技术实现弹窗提示实例

PowerShell中的强类型数组介绍

精品推荐
分类导航