Jump to content

Nexusphreez

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Nexusphreez

  1. So here is a script that I use and just set it up on a schedule. What it does is create a local and/or domain account with the specified user name and password. I can run it manually, on an individual system basis or through a workflow. The only minor drawback is that the password is listed in plain text. But my justification for this is that anyone internal to my organization is going to have access to this anyway. Its not visible to the client or anyone else. # Inputs $SetPassword = "Password Here" $SetUserName = "User Name Here" $group = "Administrators" $adsi = [ADSI]"WinNT://$env:COMPUTERNAME" $existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $SetUsername } if ($existing -eq $null) { & NET USER $SetUsername $SetPassword /add /y /expires:never & NET LOCALGROUP $group $SetUsername /add } else { $existing.SetPassword($SetPassword) } & WMIC USERACCOUNT WHERE "Name='$SetUsername'" SET PasswordExpires=FALSE
×
×
  • Create New...