Page 1 of 2 12>
Topic Options
#88538 - 2002-10-07 10:14 PM Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88539 - 2002-10-08 01:59 PM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88540 - 2002-10-08 02:27 PM Re: Win32Admin.DLL for your COMing pleasure
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I looked at it, but I saw it too late in the day to try it out.

What advantages does this have over ADSI methods?

I'd like to see some Exchange functionality added.

Top
#88541 - 2002-10-08 02:31 PM Re: Win32Admin.DLL for your COMing pleasure
Chris S. Offline
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. [Smile]
Top
#88542 - 2002-10-08 02:37 PM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88543 - 2002-10-08 02:37 PM Re: Win32Admin.DLL for your COMing pleasure
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I like the socket but don't mind the html daemon.
 
_________________________
!

download KiXnet

Top
#88544 - 2002-10-08 02:40 PM Re: Win32Admin.DLL for your COMing pleasure
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
My list:

Terminal Server user property support
Create & manage child processes
Socket support (maybe) Mini HTTP Daemon ?
ACL reading/modification

and a mod:

Read/Write binary files

the last one might be tough to integrate into kixtart.

-Shawn

ps I like to see file handling like in the old unix stdio days ... you know ... things like binary read and writes and seeks and stuff.

[ 08. October 2002, 14:43: Message edited by: Shawn ]

Top
#88545 - 2002-10-08 02:47 PM Re: Win32Admin.DLL for your COMing pleasure
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
But I think I already mentioned this to you Howard - the number one thing I think would be most usefull is a simplified version of the ADsSecurity snapin. Like a COMable XCACLS with an interface that makes sense (for a change).
Top
#88546 - 2002-10-08 02:55 PM Re: Win32Admin.DLL for your COMing pleasure
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Speaking of ADsSecurity and the reg perms thing. I don't recall if anyone actually demonstrated how or if that can be done.

On the socket support, more than HTTP is desirable. Stuff like FTP, TELNET, etc.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#88547 - 2002-10-08 03:06 PM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88548 - 2002-10-08 03:14 PM Re: Win32Admin.DLL for your COMing pleasure
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The FTP thingy would be kinda neat - there are some commercial/freeware versions out there - but a board supported version would be much cooler.

In terms of ADsSecurity ... the bloody object model is way too complex and conviluted. Plus any script (I've seen) that use it - ends up sugar coating and wrapping all the functions anyways. It takes many dozens of lines just to setup perms on a share - its crazy !

[ 08. October 2002, 15:16: Message edited by: Shawn ]

Top
#88549 - 2002-10-08 03:16 PM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I don't believe I need to use ADsSecurity.DLL at all.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88550 - 2002-10-09 03:42 AM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88551 - 2002-10-09 02:20 PM Re: Win32Admin.DLL for your COMing pleasure
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
No attachments? [Wink]

I'll give it a try.

Top
#88552 - 2002-10-09 02:25 PM Re: Win32Admin.DLL for your COMing pleasure
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Hmm. I can Blat, but I can't W32_Mail.

{edit} My bad. It worked!

[ 09. October 2002, 14:26: Message edited by: Chris S. ]

Top
#88553 - 2002-10-09 03:10 PM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88554 - 2002-10-09 08:33 PM Re: Win32Admin.DLL for your COMing pleasure
kholm Offline
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 [Wink]

Btw.
The only part i have tried is the mail-part, and that works like a charm.

-Erik

Top
#88555 - 2002-10-09 08:49 PM Re: Win32Admin.DLL for your COMing pleasure
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, for simplicitys sake some parts could be cut of to separate object...

like having a toolkit inside one dll.
_________________________
!

download KiXnet

Top
#88556 - 2002-10-09 09:30 PM Re: Win32Admin.DLL for your COMing pleasure
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#88557 - 2002-10-11 09:48 PM Re: Win32Admin.DLL for your COMing pleasure
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
quess what is thing that could be added?

shortcuts.
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.125 seconds in which 0.07 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org