WHAT?!?!?! You know DOS???

My hat's off to you! When I taught parts of the MCSE course, the students had been in the class for about 8 months before I started teaching Networking and IIS. The first two days of Networking actually had to be an Intro to DOS because nobody had EVER seen a command prompt, and they had no idea that you actually had to TYPE the Ping command! \:\)

The "clue" was directed at Robdutoit.. I pretty much ignored your function as it just identifies the admin name and feeds it to the Net command.

The User Admin Serviice is a recent addition and might have been useful if this was all you were doing. It's advantage is that you can use the user's login process to detect if an action is needed, and then push it out with the desired credentials for implementation.

As for the Cypher UDF, I'm sure the uber-geeks at the NSA could crack it, but the typical hacker likely could not. Here's the basic idea for using it:
 Code:
; Load the cypher UDF
Call 'path\cypher.k61'  ; NOTE - This is pre-tokenized - use the correct version!
; rest of your code inits go here...


; Read and decrypt the password from an INI file
; Note that the extension is .CFG and not .INI, the section is "NETCMD", and 
; the value read is "PVal". This simply makes the data less obvious as
; the file is plain text.
$Password = ReadProfileString('path\startup.cfg', 'NETCMD', 'PVal')

; decrypt the password using a pre-defined key.
; Permanent/embedded key - the  script must be edited, tokenized, and distributed to change this
;$CypherKey = 704
; Stored Key - can be written when the password is encoded and can be changed anytime
; When I use this method, I don't use this value directly but have some permanent
; value in the scripts that adds, subtracts, or otherwise alters this by a fixed amount,
; thus, this external value is only part of the key. In this example, I treat the key
; as a string and add a digit to the beginning and end
$CypherKey = Val('8' + ReadProfileString('path\startup.cfg', 'NETCMD', 'CVal') + '5')

; Cycle Length (# of "codewheels") - set to 0 for default of 2048
$Len = 0

; Set the direction (1=encode,0=decode in this example, must be opposite of value used when encoding)
; This can also be read from the .CFG file
$Dir = 0

; Now we can decrypt the Password
$Password = Cypher($Password, $CypherKey, $Dir, $Len)

; with the password now stored in the variable in clear text, the rest of your script
; can continue here..
You would then tokenize your script using KIX32 -T myscript.kix, which would generate a tokenized .KX file. That file is called like any other, it just isn't in a viewable or editable form.

There's also a CODEC UDF here in source that uses a complex ROT13 based algorithm that will give some idea of what's going on in data encoding/decoding, although cypher is much more complex.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D