-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetuser.ps1
More file actions
13 lines (13 loc) · 828 Bytes
/
setuser.ps1
File metadata and controls
13 lines (13 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#ps1_sysnative
secedit /export /cfg c:\secpol.cfg
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
rm -force c:\secpol.cfg -confirm:$false
([adsi]"WinNT://$env:computername/Administrator").SetPassword('welcome2ibm')
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/Auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM in" protocol=TCP dir=in profile=any localport=5985 remoteip=any localip=any action=allow
netdom renamecomputer "$env:COMPUTERNAME" /Newname "ws03-rm0" /Force /REboot 0