Hi,
I am trying to write a script that kills processes that generated by the OS on a localhost. The problem is that this script must be run under a user with administrator privileges, otheriwse the script wont be able to kill the processes.
Generally speaking, this script doesn't suppose to run under administrator but under a standard user privileges.
I am using the following commands in order to open the WMI connection:
Again, the WMI need to be executed locally and not remotely. - my $WMI = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate,(security)}//127.0.0.1" )
-
$WMI->Security_->Privileges->AddAsString ('SeDebugPrivilege', 1);
Is there a way to set the script to connect to WMI using administrator privileges? (assuming, of course, that I have administrator credentials).
Thanks,
Ido.
5 4407
Hi,
I am trying to write a script that kills processes that generated by the OS on a localhost. The problem is that this script must be run under a user with administrator privileges, otheriwse the script wont be able to kill the processes.
Generally speaking, this script doesn't suppose to run under administrator but under a standard user privileges.
I am using the following commands in order to open the WMI connection:
Again, the WMI need to be executed locally and not remotely. - my $WMI = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate,(security)}//127.0.0.1" )
-
$WMI->Security_->Privileges->AddAsString ('SeDebugPrivilege', 1);
Is there a way to set the script to connect to WMI using administrator privileges? (assuming, of course, that I have administrator credentials).
Thanks,
Ido.
To begin with, what is "WMI"? I haven't heard of that.
Doing things with Administrative privilage, especially remotely, is a definite NO NO. You will find that many places that set up machines for remote access, have it set to the administrator cannot log in remotely. This prevents questionable parties from doing so.
Regards,
Jeff
You need to use the swbemlocator like so: - $locator = Win32::OLE->CreateObject("WbemScripting.SWbemLocator");
-
$WMI = $locator->ConnectServer( $computer, "root/cimv2", $user, $pass);
Hi,
I am familier with the "connect server" function you have suggested.
The only problem is that this is useful in order to run WMI on remote machines, while I need to run in on a local machine.
I tried to use the "connect server" to connect to localhost but it refused, saying that connection to localhosts are not permitted.
Any other options?
Thanks,
Ido.
Hi,
I am familier with the "connect server" function you have suggested.
The only problem is that this is useful in order to run WMI on remote machines, while I need to run in on a local machine.
I tried to use the "connect server" to connect to localhost but it refused, saying that connection to localhosts are not permitted.
Any other options?
Thanks,
Ido.
If you are ON the machine that it will be running on, then why do you need to connect to it? Shouldn't you just have to run the command(s) you need?
Again, what is WMI?
Hi,
WMI stands for Windows Management Instrumentation. This is a set of extenstions by which you can retrieve information about the OS and manage its components like processes, services, memory, cpu usage etc..
My mail goal is to kill processes created by the OS. WMI is just one option to do that. Currently, all options including WMI are failing to terminate processes because administrator priviliges are required to kill those processes.
Since I intend to run the script on a local computer under a user which is not an administrator then I need to figure out a way to set the WMI command administrative privileges.
Thanks,
Ido.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ted |
last post by:
How do I grant all privileges for a schema that has a large number of
existing tables, procedures, functions, etc to a newly created role,
without having to issue a grant statement for each object...
|
by: ray well |
last post by:
hi,
are administrator rights needed when installing mdac ?
are administrator rights needed when installing .net framework ?
thanks,
ray
|
by: Stefano Bonnin |
last post by:
Hi, I'm a Postgis user, and I have a problem restoring data from 7.4 to 8.0..0beta2.
I use the postgis_restore.pl script that comes with postgis distribution.
I do the following for the dump:...
|
by: Dave |
last post by:
I want to create a program that can only be run by a user with administrator
privileges (ie in the BUILTIN/Administrators group - I think. Correct me if
I'm wrong, I'm a bit hazy on users and...
|
by: Martijn Saly |
last post by:
I'd like to test in my script, if it's going to be possible to enable
priviliges.
If I use this...
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
....it presents a...
|
by: srujan |
last post by:
Hi,
I need a script to provide administrative Privileges to install software from the network and revoke the privileges after installation of that software.I need this to install for the users...
|
by: Rahul B |
last post by:
Hi,
I want to grant only the connect, select, insert, update privileges on
all the tables of a schema to a particular user/group
Initially, i had revoked all the privileges from public.
It...
|
by: =?Utf-8?B?TWFydGluIFNhY2hz?= |
last post by:
I have been using MSCONFIG (XP Pro) for four years with no problem. I always
use it in Administrator. Last night, when I attempted to go into selective
startup mode, I got the following error...
|
by: nagar |
last post by:
I'm using the Process.Start method to launch an application from C#.
How can I launch the App as Administrator in Windows Vista?
Thanks.
Andrea
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |