This WMI script lists all the processes running under the currently logged on user account.
- - -
strComputer = "."
Dim strUserName
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_ComputerSystem")
For Each objItem in colItems
strUserName = objItem.UserName
Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process")
For Each objProcess in colProcessList
colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain)
If strUserDomain & "\" & strNameOfUser = strUserName Then
WScript.Echo "Process " & objProcess.Name & " is owned by " _
& strUserDomain & "\" & strNameOfUser & "."
End If
Next
Wednesday, February 22, 2006
Wednesday, February 15, 2006
Message "Security Center is currently unavailable"
Q: When I run Windows Security Center I get this message:
The Security Center is currently unavailable because the "Security Center" service has not started or was stopped. Please close this window, restart the computer (or start the "Security Center" service), and then open the Security Center again.
A: To start the "Security Center" service, use these steps:- Click Start, Run and type Services.msc
- Double-click "Security Center" service from the listing
- Set the startup type of the service to "Automatic"
- Start the service by clicking the "Start" button in that applet.
Tuesday, February 07, 2006
Question: I'm attempting to find out how to use a WMI or VBScript to modify the default "Open With" program for a given 'File Type' in Windows XP. (Both Local and Remote systems using WMI) I have users that want to open .DOC files in WordPad.exe instead of WordView.exe.
Is there an Object or Method that exposes this availability? If so, does anybody have any code snips? I have to update about 1000+ computers and I would like to send out this script via SMS or during login.bat
Any help would be GREATLY appreciated!
Answer: The following command-line should do the trick for you:
%comspec% /c assoc .doc=WordPad.Document.1
-or-
CMD /c assoc .doc=WordPad.Document.1
This can be executed from a batch file.
Is there an Object or Method that exposes this availability? If so, does anybody have any code snips? I have to update about 1000+ computers and I would like to send out this script via SMS or during login.bat
Any help would be GREATLY appreciated!
Answer: The following command-line should do the trick for you:
%comspec% /c assoc .doc=WordPad.Document.1
-or-
CMD /c assoc .doc=WordPad.Document.1
This can be executed from a batch file.
Thursday, January 12, 2006
WinExit.scr Permissions
Question: When a limited user uses the Winexit screen saver, I get the following error message:
Answer: The Winexit.scr does not run correctly under Limited accounts by default. However, by altering the Permissions for a registry key, you can resolve the problem.
See : Logoff Screen Saver Does Not Function in Windows NT
Note that this KB was written for Windows NT, but very much applies to Windows XP as well.
For configuring the registry Permissions, see the KB below:
How To Use the Windows XP and Windows Server 2003 Registry Editor Features
"Error encountered while creating registry key. Make sure you have Set Value and Create Subkey Permissions."
Answer: The Winexit.scr does not run correctly under Limited accounts by default. However, by altering the Permissions for a registry key, you can resolve the problem.
See : Logoff Screen Saver Does Not Function in Windows NT
Note that this KB was written for Windows NT, but very much applies to Windows XP as well.
For configuring the registry Permissions, see the KB below:
How To Use the Windows XP and Windows Server 2003 Registry Editor Features
Subscribe to:
Posts (Atom)