Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create a new admin account

Two Fileset Launch Arguments Environment Varaibles would be supplied.  To add the user 'rstephens' with the password 'filewave'

VariableValue
usernamerstephens
passwordfilewave


Parameters may be supplied, that can then be added to the execution of Powershell from within the script:

Code Block
languagepowershell
Param ( 
    [string]$MyUsername = $args[0]$Env:username,
    [string]$MyPassword = $args[1]$Env:filewave
)


If ( [IntPtr]::Size * 8 -ne 64 )
{
    C:\Windows\SysNative\WindowsPowerShell\v1.0\PowerShell.exe -File $MyInvocation.MyCommand.Path -MyUsername $MyUsername -MyPassword $MyPassword
}
Else
{
    (New-LocalUser -AccountNeverExpires:$true -Password ( ConvertTo-SecureString -AsPlainText -Force $MyPassword) -Name $MyUsername | Add-LocalGroupMember -Group administrators)
}

...