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.
[CODE=perl]my $WMI = Win32::OLE->GetObject("win mgmts:{imperson ationLevel=impe rsonate,(securi ty)}//127.0.0.1" )
$WMI->Security_->Privileges->AddAsString ('SeDebugPrivil ege', 1);[/CODE]
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.
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.
[CODE=perl]my $WMI = Win32::OLE->GetObject("win mgmts:{imperson ationLevel=impe rsonate,(securi ty)}//127.0.0.1" )
$WMI->Security_->Privileges->AddAsString ('SeDebugPrivil ege', 1);[/CODE]
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.
Comment