Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

powershell equivalent

Closed Thread
 
Thread Tools Display Modes
Old 06-26-2008   #1 (permalink)
Max2006
Guest
 
Posts: n/a

powershell equivalent

What is the powershell equivalent for this command:

net user username pwd /add

Thank you...Max

 
Old 06-26-2008   #2 (permalink)
Brandon [MVP]
Guest
 
Posts: n/a

Re: powershell equivalent

For a local machine I would just use "net user" command

If you need to do this remotely:

function New-LocalUser{
# From: Brandon Shell
# Purpose: To Add User to Host Local SAM
# Example:
# -- To Add User
# PS> New-LocalUser -user Jsmith -password H!Th3r3 -server myserver1
#################################################################
Param([string]$user,[string]$password,[string]$server)

If(!($server)){$server = get-content env:COMPUTERNAME}

$tUser = [ADSI]("WinNT://$server,computer")

$newuser = $tUser.psbase.children.add("$user","user")
$newuser.psbase.invoke("SetPassword",$password)
$newuser.psbase.CommitChanges()
}

"Max2006" <alanalan1@xxxxxx> wrote in message
news:EE568410-9175-46F6-82A5-68B5AA021BC1@xxxxxx
Quote:

> What is the powershell equivalent for this command:
>
> net user username pwd /add
>
> Thank you...Max
>
 
 
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBCRLF equivalent in Powershell? Victag PowerShell 2 05-15-2008 08:35 PM
PowerShell equivalent of If (not) exist greatbarrier86 PowerShell 10 01-11-2008 08:51 AM
Is there an equivalent in powershell to get the name of the script Bob Landau PowerShell 9 09-10-2007 07:34 PM
PowerShell equivalent for ECHO ON dtward@gmail.com PowerShell 3 01-08-2007 10:45 AM
PowerShell equivalent of StartName Andrew Watt [MVP] PowerShell 1 06-28-2006 05:20 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49