svn commit: samba r20935 - in branches/SOC/bnh/vbscript: .
brad at samba.org
brad at samba.org
Sun Jan 21 19:22:18 GMT 2007
Author: brad
Date: 2007-01-21 19:22:17 +0000 (Sun, 21 Jan 2007)
New Revision: 20935
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20935
Log:
Modify the windows test setup script so that user password expiry gets turned off before the test user is created.
Modified:
branches/SOC/bnh/vbscript/WINDOWS_SETUP_README
branches/SOC/bnh/vbscript/win_setup.wsf
Changeset:
Modified: branches/SOC/bnh/vbscript/WINDOWS_SETUP_README
===================================================================
--- branches/SOC/bnh/vbscript/WINDOWS_SETUP_README 2007-01-21 17:58:56 UTC (rev 20934)
+++ branches/SOC/bnh/vbscript/WINDOWS_SETUP_README 2007-01-21 19:22:17 UTC (rev 20935)
@@ -1,9 +1,10 @@
-To setup a windows host for testing, i've created a script to create an
-adminstrative user account, and enable and start the telnet service.
+To setup a windows host for testing, i've created a script to turn off
+user password expiry, create an adminstrative user account, and enable and
+start the telnet service.
Optionally, the hostname and workgroup name can also be set.
-Copy win_setup.wsf and common.vbs into a directory (Z:\smbtest in this example),
- and follow these steps:
+Copy win_setup.wsf and common.vbs into a directory (Z:\smbtest in this
+example), and follow these steps:
Z:\smbtest>cscript win_setup.wsf /username:<username> /password:<password>
(<username> will be created, assigned the password <password>, and added to
Modified: branches/SOC/bnh/vbscript/win_setup.wsf
===================================================================
--- branches/SOC/bnh/vbscript/win_setup.wsf 2007-01-21 17:58:56 UTC (rev 20934)
+++ branches/SOC/bnh/vbscript/win_setup.wsf 2007-01-21 19:22:17 UTC (rev 20935)
@@ -140,7 +140,8 @@
end function
' If username exists, remove it.
-' Create user. Add to local Administrators group.
+' Turn off user password expiry. Create user. Add to local Administrators
+' group.
function setup_user(username, password)
on error resume next
@@ -164,6 +165,17 @@
stdout.writeline "User " & username & " removed."
end if
+ ' Turn off password expiry.
+ netaccounts_cmd = "net accounts /MAXPWAGE:UNLIMITED"
+ error_code = shell.run(netaccounts_cmd, NEW_WINDOW_MINIMIZED, True)
+ if error_code <> 0 then
+ stdout.writeline "Error calling " & netuseradd_cmd _
+ & ". Returned " & error_code & "."
+ setup_user = error_code
+ exit function
+ end if
+ stdout.writeline "User password expiry disabled."
+
netuseradd_cmd = "net user " & username & " " & password & " /ADD"
error_code = shell.run(netuseradd_cmd, NEW_WINDOW_MINIMIZED, True)
if error_code <> 0 then
More information about the samba-cvs
mailing list