Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Do {
  2. $Input = Read-Host -Prompt 'Enter username (4 symbols without spaces):'
  3. } While ($Input.length -ne 4 -And -Not ($Input -Match ' '))
  4.  
  5. New-LocalGroup -Name "GPart3$Input"
  6. New-LocalUser -Name "UPart3$Input" -NoPassword
  7. Add-LocalGroupMember -Group "GPart3$Input" -Member "UPart3$Input"
  8. Add-LocalGroupMember -Group "Пользователи" -Member "UPart3$Input"
  9. Enable-LocalUser -Name "UPart3$Input"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement