Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # script31.ps1
- $Name = ""
- while ($Name.Length -ne 4) {
- Write-Output "Enter user name (4 characters): "
- $Name = Read-Host
- if ($Name.Length -ne 4) {
- Write-Output "User name should be 4 characters length!"
- }
- }
- $UserName = "UPart3$Name"
- $GroupName = "GPart3$Name"
- New-LocalUser -Name $UserName -NoPassword
- New-LocalGroup -Name $GroupName
- Add-LocalGroupMember -Group $GroupName -Member $UserName
- Enable-LocalUser -Name $UserName
- Pause
Add Comment
Please, Sign In to add comment