locked
How to create user profile using powershell? RRS feed

  • Question

  • Hi Team,

    Currently i am using PsExec64.exe utility create user profile below is command for reference, just wanted to check can we achieve the same out put using powershell command,if yes then would appreciate if anyone share the powershell command to create user profile.

    "C:\\PsExec64.exe -u meuser -p \"NeXXXX\" logout"

    Thanks


    NM-BG

    Thursday, March 28, 2019 12:09 PM

All replies

  • Hi,

    Below you'll find a GitHub repository of PowerShell functions for creating user profiles:

    https://gist.github.com/crshnbrn66/7e81bf20408c05ddb2b4fdf4498477d8

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, March 28, 2019 12:23 PM
  • Thanks Leon for the functions, this function has only below attribute,

    -Username

    - Password

    but i need these below attribute as well along with user profile

    -AccountNeverExpires

    -PasswordNeverExpires

    -UserMayNotChangePassword

    What we can do to achieve this?



    NM-BG

    Friday, March 29, 2019 9:44 AM
  • How about this?

    $cred = Get-Credential
    $mySession = New-PSSession -ComputerName $targetMachine -Credential $cred
    Invoke-Command -Session $mySession -ScriptBlock {
        New-LocalUser <your prameters here>
    }


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Friday, March 29, 2019 6:51 PM