How to Create a local user and add to local administrators group with PowerShell

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #1241960
      Mark
      Participant
      Member Points: 692
      Rank: 2

      Hello,

      How to create a local user and add to local administrators group using a Powershell script with all possible error handling ?

      Thanks.

      avatar
    • #1241968
      Swapnil Kambli
      Moderator
      Member Points: 4,918
      Rank: 3
      • #1241973
        Mark
        Participant
        Member Points: 692
        Rank: 2

        Thank you Swapnil.

         

        Would this script be applicable for all the operating system versions below ?

        Windows Server 2000, Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2003 R2, Windows Server 2000, Windows Server 2012, Windows Server 2003 with SP1, Windows 8

    • #1241978
      Swapnil Kambli
      Moderator
      Member Points: 4,918
      Rank: 3

      Hi Nick,

      For your environment use of net group command line utility is recommended.

      Please check some of the examples in below link

      https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc754051(v%3Dws.11)

    • #1241984
      Swapnil Kambli
      Moderator
      Member Points: 4,918
      Rank: 3

      Check the documentation for ‘net’ command line tools.

      Do reply back here if you are still stuck.

      Net Localgroup

      avatar
Viewing 3 reply threads
  • You must be logged in to reply to this topic.
© 4sysops 2006 - 2022

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account