Perl Win32 Quick Reference Page 2

ADVERTISEMENT

Win32::Spawn(COMMAND, ARGS, PID)
UserSetAttributes(server, userName, password, passwordAge, privilege,
Win32::NetAdmin
Spawns a new process using the supplied COMMAND, passing in arguments
homeDir, comment, flags, scriptPath)
in the string ARGS. The pid of the new process is stored in PID. This
Sets password, passwordAge, privilege, homeDir, comment, flags, and
# FILTER_TEMP_DUPLICATE_ACCOUNTS
function is deprecated. Please use the Win32::Process module instead.
scriptPath for user.
# Enumerates local user account data on a domain controller.
#
Win32::GetProcAddress(INSTANCE, PROCNAME)
UserChangePassword(domainname, username, oldpassword,
# FILTER_NORMAL_ACCOUNT
Returns the address of a function inside a loaded library. The information
newpassword)
# Enumerates global user account data on a computer.
about what you can do with this address has been lost in the mist of time. Use
Changes a users password. Can be run under any account.
#
the Win32::API module instead of this deprecated function.
# FILTER_INTERDOMAIN_TRUST_ACCOUNT
# Enumerates domain trust account data on a domain controller.
UsersExist(server, userName
#
Checks if a user exists.
Win32::GetNextAvailDrive()
# FILTER_WORKSTATION_TRUST_ACCOUNT
Returns a string in the form of ``<d>:'' where <d> is the first available drive
# Enumerates workstation or member server account data on a domain
letter.
GetUsers(server, filter, userRef)
# controller.
Fills userRef with user names if it is an array reference and with the user
#
names and the full names if it is a hash reference.
Win32::EventLog
# FILTER_SERVER_TRUST_ACCOUNT
# Enumerates domain controller account data on a domain controller.
use Win32::NetAdmin qw(GetUsers GroupIsMember
GroupCreate(server, group, comment)
use Win32::EventLog;
UserGetAttributes UserSetAttributes);
GroupDelete(server, group)
$handle=Win32::EventLog->new("System", $ENV{ComputerName})
my %hash;
Creates (Deletes) a group.
or die "Can't open Application EventLog\n";
GetUsers("", FILTER_NORMAL_ACCOUNT , \%hash)
$handle->GetNumber($recs)
or die "GetUsers() failed: $^E";
or die "Can't get number of EventLog records\n";
GroupGetAttributes(server, groupName, comment)
foreach (keys %hash) {
$handle->GetOldest($base)
GroupSetAttributes(server, groupName, comment)
my ($password, $passwordAge, $privilege,
or die "Can't get number of oldest EventLog record\n";
Gets (Sets) the comment.
$homeDir, $comment, $flags, $scriptPath);
while ($x < $recs) {
if (GroupIsMember("", "Domain Users", $_)) {
$handle-
print "Updating $_ ($hash{$_})\n";
GroupAddUsers(server, groupName, users)
>Read(EVENTLOG_FORWARDS_READ|EVENTLOG_SEEK_READ,
UserGetAttributes("", $_, $password, $passwordAge, $privilege,
GroupDeleteUsers(server, groupName, users)
$base+$x,
$homeDir, $comment, $flags, $scriptPath)
Adds (Deletes) a user in a group.
$hashRef)
or die "UserGetAttributes() failed: $^E";
or die "Can't read EventLog entry #$x\n";
$scriptPath = "dnx_login.bat"; # this is the new login script
if ($hashRef->{Source} eq "EventLog") {
GroupIsMember(server, groupName, user)
UserSetAttributes("", $_, $password, $passwordAge, $privilege,
Win32::EventLog::GetMessageText($hashRef);
Returns TRUE if user is a member of groupName.
$homeDir, $comment, $flags, $scriptPath)
print "Entry $x: $hashRef->{Message}\n";
or die "UserSetAttributes() failed: $^E";
}
}
GroupGetMembers(server, groupName, userArrayRef)
$x++;
}
Fills userArrayRef with the members of groupName.
}
GetDomainController(server, domain, returnedName)
Returns the name of the domain controller for server.
LocalGroupCreate(server, group, comment)
$handle = Win32::EventLog->new(SOURCENAME [,SERVERNAME]);
LocalGroupDelete(server, group)
Th
new()
method creates a new EventLog object and returns a handle to it.
Creates (Deletes) a local group.
GetAnyDomainController(server, domain, returnedName)
This hande is then used to call the methods below.
Returns the name of any domain controller for a domain that is directly
trusted by the server.
LocalGroupGetAttributes(server, groupName, comment)
$handle->Backup(FILENAME);
LocalGroupSetAttributes(server, groupName, comment)
The Backup() method backs up the EventLog represented by $handle.
Gets (Sets) the comment.
UserCreate(server, userName, password, passwordAge, privilege,
homeDir, comment, flags, scriptPath)
$handle->Clear(FILENAME);
Creates a user on server with password, passwordAge, privilege, homeDir,
LocalGroupAddUsers(server, groupName, users)
Clears the EventLog represented by $handle. If a FILENAME is provided, the
comment, flags, and scriptPath.
LocalGroupDeleteUsers(server, groupName, users)
EventLog will be backed.
Adds (Deletes) a user to a group.
UserDelete(server, user)
Deletes a user from server.
$handle->Report(HASHREF);
GetServers(server, domain, flags, serverRef)
generates an EventLog entry.
Gets an array of server names or an hash with the server names and the
comments as seen in the Network Neighborhood or the server manager. For
UserGetAttributes(server, userName, password, passwordAge, privilege,
flags, see SV_TYPE_* constants.
homeDir, comment, flags, scriptPath)
$handle->Read(FLAGS, OFFSET, HASHREF);
Gets password, passwordAge, privilege, homeDir, comment, flags, and
read an EventLog entry from the EventLog.
scriptPath for user.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4