PowerShell添加本地账户 PowerShell添加本地账户脚本分享

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

PowerShell添加本地账户 PowerShell添加本地账户脚本分享

  2021-03-21 我要评论
想了解PowerShell添加本地账户脚本讲解的相关内容吗,在本文为您仔细讲解PowerShell添加本地账户的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点: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")

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们