Guest User

Untitled

a guest
Mar 14th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. Windows PowerShell
  2. Copyright (C) 2016 Microsoft Corporation. All rights reserved.
  3.  
  4. PS C:\Users\Administrator> get-localuser
  5.  
  6. Name Enabled Description
  7. ---- ------- -----------
  8. Administrator True Built-in account for administering the computer/domain
  9. cloudbase-init True
  10. DefaultAccount False A user account managed by the system.
  11. Guest False Built-in account for guest access to the computer/domain
  12.  
  13.  
  14. PS C:\Users\Administrator> Add-LocalGroupMember -Group Administrators -Member gheza^C
  15. PS C:\Users\Administrator> New-LocalUser -Name gheza -AccountNeverExpires
  16.  
  17. cmdlet New-LocalUser at command pipeline position 1
  18. Supply values for the following parameters:
  19. Password: ********
  20.  
  21. Name Enabled Description
  22. ---- ------- -----------
  23. gheza True
  24.  
  25.  
  26. PS C:\Users\Administrator> $pwd = "macaroana"
  27. PS C:\Users\Administrator> $secure = $pwd | ConvertTo-SecureString -AsPlainText -Force
  28. PS C:\Users\Administrator> New-LocalUser -Name gheza2 -AccountNeverExpires -Password $secure
  29. New-LocalUser : Unable to update the password. The value provided for the new password does not meet the length,
  30. complexity, or history requirements of the domain.
  31. At line:1 char:1
  32. + New-LocalUser -Name gheza2 -AccountNeverExpires -Password $secure
  33. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. + CategoryInfo : InvalidArgument: (:) [New-LocalUser], InvalidPasswordException
  35. + FullyQualifiedErrorId : InvalidPassword,Microsoft.PowerShell.Commands.NewLocalUserCommand
  36.  
  37. PS C:\Users\Administrator> $pwd = "Passw0rd"
  38. PS C:\Users\Administrator> $secure = $pwd | ConvertTo-SecureString -AsPlainText -Force
  39. PS C:\Users\Administrator> New-LocalUser -Name gheza2 -AccountNeverExpires -Password $secure
  40. New-LocalUser : User gheza2 already exists.
  41. At line:1 char:1
  42. + New-LocalUser -Name gheza2 -AccountNeverExpires -Password $secure
  43. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  44. + CategoryInfo : ResourceExists: (gheza2:LocalUser) [New-LocalUser], UserExistsException
  45. + FullyQualifiedErrorId : UserExists,Microsoft.PowerShell.Commands.NewLocalUserCommand
  46.  
  47. PS C:\Users\Administrator> New-LocalUser -Name gheza3 -AccountNeverExpires -Password $secure
  48.  
  49. Name Enabled Description
  50. ---- ------- -----------
  51. gheza3 True
  52.  
  53.  
  54. PS C:\Users\Administrator> net user
  55.  
  56. User accounts for \\WIN-1QJVGL6GS4T
  57.  
  58. -------------------------------------------------------------------------------
  59. Administrator cloudbase-init DefaultAccount
  60. gheza gheza2 gheza3
  61. Guest
  62. The command completed successfully.
  63.  
  64. PS C:\Users\Administrator> net user gheza3 /logonpasswordchg:yes
  65. The command completed successfully.
  66.  
  67. PS C:\Users\Administrator>
Add Comment
Please, Sign In to add comment