home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Planet Source Code Jumbo …e CD Visual Basic 1 to 7
/
4_2005-2006.ISO
/
data
/
Zips
/
FINAL_V6__199844632006.psc
/
clsNMC.cls
< prev
Wrap
Text File
|
2006-06-03
|
10KB
|
175 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsNMC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'***************************************************************************************
'* NMC! V1.6 NT Master Class v1.6.1 *
'* *
'* Created: April 14, 2006 *
'* Updated: June 02, 2006 *
'* Purpose: NT System Security Master Class *
'* Functions: (listed) *
'* Revision: 1.6.1 *
'* Compile: Native *
'* Referenced: Throughout Project *
'* Author: John Underhill (Steppenwolfe) *
'* *
'***************************************************************************************
' ~*** Notes ***~
'/~ Some things to know..
'/~ First off, some errors are not actually errors, but are caused by invalid input. For example,
'/~ you can not delete a user that does not exist, or create a group that already exists, these
'/~ sorts of things are user input errors, and have to be handled or ignored by your application
'/~ handlers. Some services can not be paused/restarted, that is an attribute of the service design.
'/~ You must have at least one NTFS partition in order to test the NTFS security routines, if NTFS
'/~ is not detected, these controls are disabled. Some things will work in 98/ME, some, [of course],
'/~ will not. Most of the api for service and process management is backwards compatable.
'/~ You may use this code in any way you like, as long as you agree that no warranty or
'/~ liability of any kind is expressed or implied. If you wish you can add a mention to the
'/~ about page of your project/app, ex. Credit to: John Underhill of NSPowertools.com.
'/~ April 17, 2006 - V2
'/~ Gave the code a once over and fixed a couple of things, added some options to NTFS recurse
'/~ and group routines.
'/~ April 22, 2006 - V3
'/~ Added functions Service_Remove and Service_Add. Updated User and group functions, global groups
'/~ can now be added, and extended user properties like default permissions set were added.
'/~ April 27, 2006 - V4
'/~ Fixed a bug in User_Create, that caused the example to work improperly. Added three new routines,
'/~ User_SetData (sets account properties), User_Password (change account password), and Get_Domain
'/~ (retrieve the primary dc name).
'/~ April 29, 2006 - V5 ~Final~ (!60 Functions!)
'/~ Excepting if bugs are found, this is the final rev.
'/~ Added 10 routines to Process management. Process functions are all mirrored to psapi equivilents
'/~ for NT Server compatability. Example was expanded to demonstrate split methods.
'/~ Module_EnumG2 (module enum using psapi for 2k server), Process_EnumG2 (process enum using psapi),
'/~ Return_ProcessID and Return_ProcessIDG2 (return process id from process name - psapi and kernal32 versions)
'/~ Process_ExistsG2 (test for the existence of a process using psapi)
'/~ Process_GetClass (get current process class), Process_SetClass (set process priority),
'/~ Thread_Terminate (kill a thread), Thread_GetPriority (get thread priority),
'/~ Thread_SetPriority (set new thread priority).
'/~ Added 4 new routines to user management:
'/~ User_LoadProfile (generate a new user profile), User_UnloadProfile (unload user profile)
'/~ User_LoadHive (load users profile hive into the registry), User_UnloadHive (unload the hive).
'/~ Updated the sample program with the "Extended Example" demo, to demonstrate usage of some of
'/~ the new features.
'/~ April 30, 2006
'/~ One small fix to NetLocalGroupDel and NetGroupDel declarations, and updated documentation.
'/ June 02, 2006 - V6
'/~ Added Service_Desc function to change a services description in the mmc. Proofed the Service_Add and
'/~ Service_Remove functions and updated them. Some small formatting changes.
'/ June 03, 2006
'/~ As per Lite's suggestion, added remote capabilities to all the service routines, (simply specify
'/~ UNC path to machine in optional 'sMachine' param).
'/~ Cheers
'/~ John - steppenwolfe_2000@yahoo.com
' ~*** Exposed Functions ***~
'/~ User and Group Management ~/
'/~ User_Create - create a new user [in -string (6) | out -bool]
'/~ User_Delete - delete a user account [in -string (2) | out -bool]
'/~ User_Exist - test a user account [in -string (2) | out -bool]
'/~ User_Data - get user profile data [in -string (2) | out -bool]
'/~ User_LoadProfile - create user profile [in string (4) | out -bool]
'/~ User_UnloadProfile - unload profile [in string | out -bool]
'/~ User_LoadHive - load user key [in string | out -bool]
'/~ User_UnloadHive - unload user key [in string | out -bool]
'/~ Users_List - list local|global users [in -string (3) | out -col]
'/~ User_Impersonate - impersonate a user [in -string (3) | out -bool]
'/~ User_Revert - revert to native token [out -bool]
'/~ User_RunAs - launch process as user [in -string (4) | out -bool]
'/~ User_Name - logged in user [out -string]
'/~ User_SetData - apply account changes [in -string (2) + enum | out -bool]
'/~ User_Password - change user password [in -string (4) | out -bool]
'/~ Group_Create - create a user group [in -string (3) | out -bool]
'/~ Group_Add - add user to group [in -string (3) | out -bool]
'/~ Group_Remove - remove user from group [in -string (3) | out -bool]
'/~ Group_Delete - delete a group [in -string (3) | out -bool]
'/~ Groups_List - list built-in groups [in -none | out -col]
'/~ Computer_Name - local computer name [in -none | out -string]
'/~ Get_Domain - get primary dc name [in -string | out -string]
'/~ Service Management ~/
'/~ Service_Start - start a service [in -string | out -bool]
'/~ Service_Stop - stop a service [in -string | out -bool]
'/~ Service_Pause - pause a service [in -string | out -bool]
'/~ Service_Resume - resume a service [in -string | out -bool]
'/~ Service_Query - query service state [in -string | out -long]
'/~ Service_Change - change startup attr [in -string + enum | out -bool]
'/~ Service_Enumerate - list running services [out -col]
'/~ Service_Add - add a new service [in -string (6) | out -bool]
'/~ Service_Remove - delete a service [in -string | out -bool]
'/~ Service_Desc - change svc description [in -string (2) | out -bool]
'/~ Process Management ~/
'/~ Process_Enumerate - list processes (kernal32) [out -col]
'/~ Process_EnumG2 - list processes (psapi) [out -col]
'/~ Process_Exists - test existence (kernal32) [in -string | out -bool]
'/~ Process_ExistsG2 - test existence (psapi) [in -string | out -bool]
'/~ Process_Terminate - terminate a process [in -string | out -bool]
'/~ Process_GetClass - get process class [in -long | out -long]
'/~ Process_SetClass - change process priority [in - string + enum | out -bool]
'/~ Return_ProcessID - return prc id (kernal32) [in -string | out -long]
'/~ Return_ProcessIDG2 - return prc id (psapi) [in -string | out -long]
'/~ Thread_Enumerate - list a process threads [in -string | out -bool]
'/~ Thread_Suspend - suspend a thread [in -long + string | out -bool]
'/~ Thread_Resume - resume a thread [in -long + string | out -bool]
'/~ Thread_GetPriority - get thread priority [in -long | out -long]
'/~ Thread_SetPriority - set thread priority [in -long + enum | -out bool]
'/~ Thread_Terminate - kill a thread [in -long | out -bool]
'/~ Module_Enumerate - list a process modules [in -string | out -col]
'/~ Module_EnumG2 - server enum (psapi) [in -string | out -col]
'/~ Encrypted File System ~/
'/~ EFS_Status - file/folder state [in -string | out -long]
'/~ EFS_Encrypt - encrypt file/folder [in -string | out -bool]
'/~ EFS_Decrypt - decrypt file/folder [in -string | out -bool]
'/~ EFS_Enable - enable EFS [in -string | out -bool]
'/~ EFS_Disable - disable EFS [in -string | out -bool]
'/~ Create_Directory - create a directory [in -string | out -bool]
'/~ File_Exists - test for path/file [in -string | out -bool]
'/~ NTFS File System ~/
'/~ NTFS_Drive - test drive for ntfs [in -string(1) | out -bool]
'/~ NTFS_Check - test all drives for ntfs [out -col]
'/~ NTFS_Folder - modify object security [in -string/enum | out -bool]
'/~ NTFS_Recursive - recurse permissions set [in -string | out -bool]
'/~ NTFS Registry ~/
'/~ NTFS_Key - modify key security [in -string/enum | out -bool]
' ~*** Events ***~
'/~ eNComplete - task completed successfully
'/~ eNErrorCond - error condition
'> Start User/Group Depend lhot User/Group
'/t/~ Thread_Enumerate - list a process threads CF~ NTFS_Checong | os CF~