#88538 - 2002-10-07 10:14 PM
Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
See Win32Admin.DLL for some additional COM functionality.
The script at the web site has a combination of documentation and example code. Let me know what additional functionality you would like added. As it stands now, I will be adding code every few days so that this DLL will provide unparalleled Win32 power for your KiXtart code.
Some sample code... code:
break ON
; Win32Admin.DLL documentation and example KiXtart code
; All methods set return data or true on success or nothing on failure. ; Also @error is set when an error occurs but does not seem to be reset on success. ; Therefore, checking the function result seems to be the best method of ; determining when an error occurs. ; @Error may not reflect the actual error of methods. Be sure to ; check @serror as it will reflect the correct text of the COM error.
$Win32Admin = createobject("Win32Admin") if vartypename($Win32Admin) <> "Object" ? "@serror" endif
$Version = $Win32Admin.Version if @error <> 0 ? "@serror" endif ? "DLL Version = " + $Version
; Method EnumTrustedDomains(optional $Server) ; Returns an interleaved array: DomainName, DomainSid. ; If a server name is specified, the enumeration is based ; on the domain where the server resides. If no server is supplied, ; then the computer where the script is executing will be used by ; default. $Domains = $Win32Admin.EnumTrustedDomains(@wksta) if @error <> 0 ? "@serror" endif for $i=0 to ubound($Domains) Step 2 ? "Domain = " + $Domains[$i] + " Sid = " + $Domains[$i+1] next
[ 08. October 2002, 13:27: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#88539 - 2002-10-08 01:59 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Here is a list of functionality I am considering adding to Win32Admin.DLL after completing the basic stuff.
User properties Terminal Server user property support NETLOGON support (secure channels, SAM replcation, etc) Read/Write CAB files Read/Write ZIP files Create & manage child processes DFS support (no place to test yet) Socket support (maybe) Mini HTTP Daemon ? Read/Write delimited files ACL reading/modification
Has anyone looked at this yet? If so, what do you want to see in it?
|
Top
|
|
|
|
#88541 - 2002-10-08 02:31 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Oh yeah, and a BIGGIE would be remote execution of commands while passing user credentials to the remote client so the remote commands can access network resources.
|
Top
|
|
|
|
#88542 - 2002-10-08 02:37 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I believe that it will be faster for most functions. Functionality outside the realm of ADSI can be included. Functions can be a composite of lower level operations providing greater functionality in a single call.
I am just exploring some new possibilites and potentially providing some benefit to fellow scripters.
|
Top
|
|
|
|
#88547 - 2002-10-08 03:06 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
With time and more than a little reading/testing, I think most of what has been mentioned so far is doable.
FTP should be a no-brainer. I haven't played with telnet yet. Permissions are messy but possible.
{edit} Remember that the DLL is somewhat large and will get larger as additional DLLs are bound inside to support things such as Perms, Sockets, etc. I just want to be clear that I was positioning this DLL as an Admin tool not a standard add-in for all clients. [ 08. October 2002, 15:13: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#88549 - 2002-10-08 03:16 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I don't believe I need to use ADsSecurity.DLL at all.
|
Top
|
|
|
|
#88550 - 2002-10-09 03:42 AM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Just added the ability to send SMTP email via KiXtart and Win32Admin.DLL. [ 09. October 2002, 03:43: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#88551 - 2002-10-09 02:20 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
No attachments?
I'll give it a try.
|
Top
|
|
|
|
#88553 - 2002-10-09 03:10 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I didn't see a need for attachments from an Administrative script, but after I get Les' FTP installed, I may revisit mail. [ 09. October 2002, 15:11: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#88554 - 2002-10-09 08:33 PM
Re: Win32Admin.DLL for your COMing pleasure
|
kholm
Korg Regular
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Howard,
I would like if you could split this util in two:- Communication part – containing FTP and Mail function
- Admin part – containing the SAM/ADS functions
From scheduled/administrative tasks that checks if all servers/subnets/routers are alive i would only require the ability send small mails (no attachments) Another serverside task could be scheduled downloads of antivirus definitions using FTP. This is just a small wish, and if others don’t see the need for the split, or if the reuse of code is easyer using one bucket, just keep up eapanding the possibilityes
Btw. The only part i have tried is the mail-part, and that works like a charm.
-Erik
|
Top
|
|
|
|
#88556 - 2002-10-09 09:30 PM
Re: Win32Admin.DLL for your COMing pleasure
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
At this point in time I am limited to one object.
I can create multiple DLLs, but each one would be a minimum of ~500KB. I thought that one DLL/object with many methods would be easier to use/maintain as well as reduce disk space consumption and D/L time (1 vs many DLLs).
Since this is a work in progress, I am open to all suggestions about making this better and easier to use.
I wanted to use the Lonkero's different toolkits in one DLL, but am limited by the current compiler. As soon as I can figure out how to use different objects for COMM, ADMIN, ETC I will.
Until then I was hoping on feedback on the interleaved array implementation for returning related but dissimilar data. I could return a VB "Scripting.Dictionary" object, but that adds a WSH requirement on the client as well as a performance hit. Still looking for functionality and the best way to delivery it. [ 11. October 2002, 00:11: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|