-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupcomputer.ps1
30 lines (20 loc) · 1.84 KB
/
setupcomputer.ps1
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
#c:\tmp\datafiles
$username = "demouser"
$domain = "its"
$password = "hfy/ffe3"
$controllerfile = "c:\tmp\control.txt"
$logdirfile = "c:\tmp\logdirfile.txt"
#Create Control Files
"0" > $controllerfile
"" > $logdirfile
#Setup Auto Logon
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1 -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value "$domain\$username" -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value $password -Force
#Setup Scheduled task to run tests (run as admin) (what account does it run as?)
#schtasks /Create $datadir\StartScriptTask.xml /TN StartTestScript
#Copy bat file to run from task
wpr -DisablePagingExecutive on
Restart-Computer
#Reboot
#reboot /r /t 30 //Not workin!