Create Local User
Clear-Host
$localuser = "User"
$password = ""
$description = "Auto Logon Account"
$computer = [ADSI]"WinNT://$env:computername,computer"
$user = $computer.Create("User", $localuser)
$user.SetPassword($password)
$user.SetInfo()
$user.Description = [String] $description
$user.SetInfo()
$localuser = "User"
$password = ""
$description = "Auto Logon Account"
$computer = [ADSI]"WinNT://$env:computername,computer"
$user = $computer.Create("User", $localuser)
$user.SetPassword($password)
$user.SetInfo()
$user.Description = [String] $description
$user.SetInfo()
Add to local group
$sysname = gwmi -q "Select Name from Win32_ComputerSystem"
$admgrp = [ADSI]”WinNT://$($sysname.Name)/Administrators,group”
$admgrp.add("WinNT://$($sysname.Name)/user")
$admgrp = [ADSI]”WinNT://$($sysname.Name)/Administrators,group”
$admgrp.add("WinNT://$($sysname.Name)/user")
So after I got those scripts together and added them to my task sequence and deployed it to a laptop, I found another thing I missed. (Note that I'm only missing these things because instead of using an image based deployment, I'm installing the operating system from scratch so alot of customization has to be done afterward.) The Security Center in Windows XP was active. Normally when building an image I would have just gone in and unchecked the three check boxes in the Security Center that relate to alerting me about things, but when looking up how to do this through the registry or through PowerShell I discovered that you can simply turn off the Security Center service and disable the entire thing. Below is the script for that.
Disable Security Center
Stop-Service "Security Center"
Set-Service -name wscsvc -startuptype disabled
Set-Service -name wscsvc -startuptype disabled
Enjoy

No comments:
Post a Comment