创建本地用户脚本

来源:互联网 发布:js注解快捷键 编辑:程序博客网 时间:2024/05/21 17:55

function create-account 
([string]$accountName = "testuser") 
$hostname = hostname 
$comp = [adsi] "WinNT://$hostname" 
$user = $comp.Create("User", $accountName) 
$user.SetPassword("Password1") 
$user.SetInfo() 
} 
创建本地用户脚本