#89756 - 2002-11-27 05:48 AM
Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
A new method has been added to Win32Admin.DLL.
Method: UserSetProps( $Server, $Account, $Properties)
code:
; $Server : "ServerName" ; $Account : "User1" ; $Properties is a string of property and value pairs. "property=value;" ; The "=" and ";" is required for each property/value pair. ; Properties: ; name => 'testuser', (use to rename an account) ; password => 'testpassword', ; home_dir => '\\\\testserver\\testshare', ; comment => 'test users comment', ; flags => numeric, ; script_path => '\\\\testserver\\testshare\\logon_script.bat', ; full_name => 'test users full name', ; usr_comment => 'test users usr comment', ; workstations => 'comp0001,comp0002,comp0003,comp0004,comp0005,comp0006,comp0007,comp0008', ; acct_expires => epoch seconds time() + 3600 * 24, ; logon_hours => a string of 168 1's and/or 0's, each digit represents 1 hour of the 168 hours in a week ; country_code => numeric, ; code_page => numeric, ; primary_group_id => numeric, 513 = "domain users" the RID of the group ; profile => '\\\\testserver\\testshare\\profile_dir', ; home_dir_drive => 'Y:' ; ; The command returns true (1) on success. ; ; Be very careful when modifying account properties. Research each one before use. ;
code:
$Win32Admin = createobject("Win32Admin") if vartypename($Win32Admin) <> "Object" ? "@serror" endif
$props = "password=abc123;" + "full_name=John Smith;" + "primary_group_id=513;" if $Win32Admin.UserSetProps("server1", "user1", $props) ? "properties successfully set" else ? "UserSetProps failed: @serror" endif
The updated DLL can be downloaded from my website. [ 27. November 2002, 06:31: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#89758 - 2002-11-27 01:40 PM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Please define the level of TS support you want. I can add manipulation of WTS account user properties without much issue. Les forwarded a WTS manager DLL for inspection that seems to be more geared toward server/session management than user management. I have yet to find similiar functionality to add to my DLL.
|
|
Top
|
|
|
|
#89759 - 2002-11-27 01:43 PM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Actually after adding the WTS and a suitable testing period I was going to declare a version 1.0 product.
Has anyone found any issues that needs to be corrected before this happens?
To date I have had very little feedback. [ 27. November 2002, 13:44: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#89762 - 2002-11-27 01:52 PM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
No that wasn't it, but I can provide access to all the WTS user account properties.
|
|
Top
|
|
|
|
#89763 - 2002-11-27 01:57 PM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Darn, the new functionality is missing a couple lines of code that make the Logon_hours works.
I will correct this sometime later today. [ 27. November 2002, 13:57: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#89766 - 2002-11-27 02:05 PM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
And the properties can be in any order within the string...
|
|
Top
|
|
|
|
#89768 - 2002-11-28 05:06 AM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
The problem with setting logon_hours with UserSetProps has been corrected.
Also UserGetInfo($Server, $Account) was added to extract 27 properties of the user account. Some are of little interest. But you can adjust and set account's logon_hours using the GUI and then extract that value as a string of 168 1's and 0's to be used as a template in setting the property of other accounts.
The DLL and win32test.kix script have been updated on the web site.
|
|
Top
|
|
|
|
#89769 - 2002-11-28 06:16 AM
Re: Win32Admin.DLL updated
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Howard,
Been doing some digging into FTP..
How about FTPPutfile, FTPGetfile?
Kent
|
|
Top
|
|
|
|
#89770 - 2002-11-28 06:38 AM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Already in there... code:
; Method FTP($RemoteServer, $Account, $Password, $Mode, $LocalDir, $RemoteDir, $Action, $Filename) ; $Mode -> [ascii|binary] ; $Action -> [get|put|size] ; ; Performs the specified FTP operation. ; Be sure to double the "@" in the password or email address if used for anonymous logons.
$RemoteServer = 'server.xyz.com' $Account = 'user1' $Password = 'password' $Mode = 'ascii' $LocalDir = 'c:\data' $RemoteDir = '' $Action = 'get' $Filename = 'file.txt'
if $Win32Admin.FTP( $RemoteServer, $Account, $Password, $Mode, $LocalDir, $RemoteDir, $Action, $Filename) ? ? "FTP successful" ? else ? ? "FTP Failed! @serror" ? endif
|
|
Top
|
|
|
|
#89772 - 2002-11-28 07:34 AM
Re: Win32Admin.DLL updated
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
The link has been fixed. Thanks for letting me know.
As for my version numbers, I will change it to 1.0 when I get the core functionality in it. I need to add WTS user account management. I increment the last column when a trival change occurs like updating the help file or a tiny code fix is applied.
I increment the third number when I add a method to the existing functional groups.
I increment the second digit when I add new functionality or the code under goes a significant rewrite.
I increment the first digit if the compiler changes or I completely rewrite the code and change the data types or structures that are returned by methods. [ 28. November 2002, 07:35: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#89774 - 2002-11-28 07:50 AM
Re: Win32Admin.DLL updated
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
patrick, you know, when you rewrite the code, how sure can you be that it is perfect?
you don't want to call the pre-release of 1.0 as 0.9.9 (many ppl do though) it actually is misleading as the numbers can grow to something like 0.12.57
so, for the betas and such, I take it as telling of having lot changed code which is not stable enough to be called a release. well, proven stable enough.
like shawn has gone, he has no betas as he would have all the time those. even his build numbers are not correct as he can make multiple private builds which has the same name as the to be released one (which is damn confusing)
what it comes down to, is to make it look clear what is happening.
also, came to think ms also, xp was to be a great OS we have not seen before and the version number tells us the reality, slighty improven w2k.
_________________________
!download KiXnet
|
|
Top
|
|
|
|
#89775 - 2002-11-29 03:14 AM
Re: Win32Admin.DLL updated
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Howard,
I feel really silly with the FTP stuff that I had been working with.
You had already had this under my nose.
Sheesh!
Kent
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 657 anonymous users online.
|
|
|