$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")
本文链接: https://www.pstips.net/add-local-account.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!