$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”)
© 版权声明
文章版权归作者所有,未经允许请勿转载。