function create-account
([string]$accountName = "testuser")
{
$hostname = hostname
$comp = [adsi] "WinNT://$hostname"
$user = $comp.Create("User", $accountName)
$user.SetPassword("Password1")
$user.SetInfo()
}
创建本地用户脚本
本文介绍了一个使用 PowerShell 编写的简单脚本,该脚本可以用于在 Windows 系统上创建本地用户账户,并设置默认密码。通过此脚本,用户能够快速地批量创建账户。
327

被折叠的 条评论
为什么被折叠?



