In inetmgr you can set the property I desire by going to Home Directory -> Application Settings -> Execute Permissions -> and setting the drop down to 'Scripts Only'. I'm trying to replicate this behavior in Powershell. The Target OS is Windows Server 2003 running IIS6.
Currently I have this simple code to get the site:
$Site = get-wmi...
I don't have access to a multi-socketed computer, so I am unsure if the following will get the grand total of processors and logical processors. I assume ManagementObjectSearcher will return an instance for each socketed CPU and I just keep a running total?
int totalCPUs = 0;
int totalLogicalCPUs = 0;
ManagementObjectSearcher mos = ne...
ObjectGetOptions options = new ObjectGetOptions();
ManagementPath p = new ManagementPath("\\\\server01\\root" + "\\cimv2:Win32_Share");
// Make a connection to a remote computer.
ManagementScope scope = new ManagementScope("\\\\server01\\root\\cimv2");
scope.Connect();
// Create a ManagementClass object
ManagementClass managementClas...
Hi all,
I need to export the WebSite Configuration (MetaBase) from IIS6 for a whole server, but I need each web site configuration to be saved separately. The result should be the same that can be obtained by right clicking on each Web Site in IIS Snap-in and selecting All Tasks->Save Configuration to a File.
My idea is quite simple:
1- ...
Hi there,
I'm looking to calculate the total size of all shared folders (except admin shares) on a number of different servers (consolidating all accessed files to a NAS box for easier backup / restore) but am having a bit of trouble finding a solution.
I'm certain this could be done in powershell but I just can't find the right inform...
How can programmatically check wich version of the WMI (Windows Management Instrumentation) is installed using delphi or C# ?
thanks in advance.
...
Scenario
I have a bunch of processes running on a server as part of various C# Applications.
Occasionally some of these crash for whatever reason (old legacy code that I don't currently have the time to replace or refactor).
Idea
I want to create a C# Service that continually checks to see if these processes are running, and if not, ...
Scenario
I have a method that returns a list of processes using WMI.
If I have 3 processes running (all of which are C# applications) - and they all have THE SAME PROCESS NAME but different command line arguments, how can I differentiate between them If I want to start them or terminate them!?
Thoughts
As far as I can see, I physicall...
I am currently using WMI to query various details about the underlying hardware in order to uniquely identify a machine. To this end, I came across a field called "Signature" under "Win32_DiskDrive". Is this signature unique across machines (globally)? Can this be used reliably to identify the machine?
Thanks,
Ananth
...
Hi all,
Is there a way to create a Refresher object to obtain statistical Performance Counters data in .NET?
There are plenty examples how to do it in unmanaged C++ and in VBScript, but no one in C#.NET
Sincerely,
Ilya Sotin
...
In Windows 2008R2, in Resource Monitor in the Disk Activity section I can see the number of bytes read from/written into files. How can I do this in a programmatic manner, preferably using C# (or Win32 API)? I have looked into WMI and various performance counters, however I cannot figure out if there is something which suits my needs.
...
i want to write 2 program:
1) programm saves all local users to the file.
2) loads file find that users not found on local machine and create user.
for searching all users which create on local machine i use next code:
foreach (ManagementObject user in userSearcher.Get())
{
if ((bool)user["LocalAccount"])
{
string...
Scenario
I've written a WMI Wrapper that seems to be quite sufficient, however whenever I run the code to start a remote process on a server, I see the process name appear in the task manager but the process itself does not start like it should (as in, I don't see the command line log window of the process that prints out what it's doin...
i have the code which find all local users:
ManagementObjectSearcher userSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_UserAccount");
foreach (ManagementObject user in userSearcher.Get())
{
if ((bool)user["LocalAccount"])
{
string UserName = (string)user["Nam...
I am new to WMI. How to write WMI(Windows Management Instrumentation) event Consumer in C? any help will be appreciated. thanks
jpram
...
Hi,
I am trying to update a replica list on a Exchange 2003 public folder. I am using the WMI namespace exchange_publicfolder to try and add an Exchange server (using the servers DN) to the AddReplica procedure. Every time I run this I get an invalid parameter as an exception.
Below is the code that I am using to do this.
WMI.C...
Hi,
I'm using WMI in .NET to connect to remote machines in a web app. When I initialize the connection, the Management ConnectionOptions always require a username and password in text. I was wondering if there was a way for it to use the context of the current Windows user, eg via page.user.identity. If I leave the connectionoptions ...
When querying for large ammount of data through WMI (say the windows events log Win32_NTLogEvent) it is very useful to know what kind of numbers you are getting yourself into before downloading all the content. Is there a way two do this?
From what i know there is no "Select Count(*) FROM Win32_NTLogEvent" in WQL.
From what i know the ...
Hi All,
I am using WMI to get SMBIOS data and for that I am using following code to initialize the IWbemLocator interface through a call to CoCreateInstance.
CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWebLocator, (LPVOID *) &pLoc);
But it always returns FAILURE. I think its due to some environment issue but w...
Hi,
The background of my question is associated with Tesseract, the free OCR engine (1985-1995 by HP, now hosting in Google). It specifically requires an input file and an output file; the argument only takes filename (not stream / binary string), so in order to use the wrapper API such as pytesser and / or python-tesser.py, the OCR tem...