PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > Win32_Product query hangs when logged into Domain
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Win32_Product query hangs when logged into Domain

Réponse
 
LinkBack Outils de la discussion
Vieux 26/11/2007, 11h38   #1
marcossoft
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Win32_Product query hangs when logged into Domain

Hi all,

I'm trying to run the script below to get all installed software on my
Windows XP SP2 box. When I'm logged in locally (on the computer itself) it
works flawlessly but when I'm logged into my company's Domain Controller the
script hangs, the processor hits 100% of usage and nothing is returned :-(,
could someone provide me any clue ?.

PS.: The user logged into the domain is part of the machine's Administrators
group.

' The script (as it was copied from TechNet)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("c:\scripts\software.tsv", True)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")

objTextFile.WriteLine "Caption" & vbtab & _
"Description" & vbtab & "Identifying Number" & vbtab & _
"Install Date" & vbtab & "Install Location" & vbtab & _
"Install State" & vbtab & "Name" & vbtab & _
"Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _
& "Version"

For Each objSoftware in colSoftware
objTextFile.WriteLine objSoftware.Caption & vbtab & _
objSoftware.Description & vbtab & _
objSoftware.IdentifyingNumber & vbtab & _
objSoftware.InstallDate2 & vbtab & _
objSoftware.InstallLocation & vbtab & _
objSoftware.InstallState & vbtab & _
objSoftware.Name & vbtab & _
objSoftware.PackageCache & vbtab & _
objSoftware.SKUNumber & vbtab & _
objSoftware.Vendor & vbtab & _
objSoftware.Version
Next
objTextFile.Close

Thank you very much !!
Marcos
  Réponse avec citation
Vieux 26/11/2007, 13h37   #2
Jeffery Hicks [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Win32_Product query hangs when logged into Domain

WMI queries for this class are notoriously slow and resource intensive. Are
your running this script locally on the DC or accessing it remotely? How is
resource utilization on the DC? Is it doing other things in addition to
being a domain controller?

--
Jeffery Hicks
Microsoft PowerShell MVP
http://www.scriptinganswers.com
http://www.powershellcommunity.org

Now Available: WSH and VBScript Core: TFM
Coming Soon: Windows PowerShell: TFM 2nd Ed.
"marcossoft" <marcossoft@discussions.microsoft.com> wrote in message
news:0CDC4DAC-8882-4EE8-B350-D0FBB865DA47@microsoft.com...
> Hi all,
>
> I'm trying to run the script below to get all installed software on my
> Windows XP SP2 box. When I'm logged in locally (on the computer itself) it
> works flawlessly but when I'm logged into my company's Domain Controller
> the
> script hangs, the processor hits 100% of usage and nothing is returned
> :-(,
> could someone provide me any clue ?.
>
> PS.: The user logged into the domain is part of the machine's
> Administrators
> group.
>
> ' The script (as it was copied from TechNet)
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objTextFile = objFSO.CreateTextFile("c:\scripts\software.tsv", True)
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colSoftware = objWMIService.ExecQuery _
> ("Select * from Win32_Product")
>
> objTextFile.WriteLine "Caption" & vbtab & _
> "Description" & vbtab & "Identifying Number" & vbtab & _
> "Install Date" & vbtab & "Install Location" & vbtab & _
> "Install State" & vbtab & "Name" & vbtab & _
> "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _
> & "Version"
>
> For Each objSoftware in colSoftware
> objTextFile.WriteLine objSoftware.Caption & vbtab & _
> objSoftware.Description & vbtab & _
> objSoftware.IdentifyingNumber & vbtab & _
> objSoftware.InstallDate2 & vbtab & _
> objSoftware.InstallLocation & vbtab & _
> objSoftware.InstallState & vbtab & _
> objSoftware.Name & vbtab & _
> objSoftware.PackageCache & vbtab & _
> objSoftware.SKUNumber & vbtab & _
> objSoftware.Vendor & vbtab & _
> objSoftware.Version
> Next
> objTextFile.Close
>
> Thank you very much !!
> Marcos


  Réponse avec citation
Vieux 26/11/2007, 14h16   #3
Jeffery Hicks [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Win32_Product query hangs when logged into Domain

Your code works fine when executed locally on my 2003 SP2 test domain
controller. Although there was only 1 app installed so it didn't take long.
If your DC has a lot of apps, this will certainly take time to process.

--
Jeffery Hicks
Microsoft PowerShell MVP
http://www.scriptinganswers.com
http://www.powershellcommunity.org

Now Available: WSH and VBScript Core: TFM
Coming Soon: Windows PowerShell: TFM 2nd Ed.
"marcossoft" <marcossoft@discussions.microsoft.com> wrote in message
news:0CDC4DAC-8882-4EE8-B350-D0FBB865DA47@microsoft.com...
> Hi all,
>
> I'm trying to run the script below to get all installed software on my
> Windows XP SP2 box. When I'm logged in locally (on the computer itself) it
> works flawlessly but when I'm logged into my company's Domain Controller
> the
> script hangs, the processor hits 100% of usage and nothing is returned
> :-(,
> could someone provide me any clue ?.
>
> PS.: The user logged into the domain is part of the machine's
> Administrators
> group.
>
> ' The script (as it was copied from TechNet)
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objTextFile = objFSO.CreateTextFile("c:\scripts\software.tsv", True)
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colSoftware = objWMIService.ExecQuery _
> ("Select * from Win32_Product")
>
> objTextFile.WriteLine "Caption" & vbtab & _
> "Description" & vbtab & "Identifying Number" & vbtab & _
> "Install Date" & vbtab & "Install Location" & vbtab & _
> "Install State" & vbtab & "Name" & vbtab & _
> "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _
> & "Version"
>
> For Each objSoftware in colSoftware
> objTextFile.WriteLine objSoftware.Caption & vbtab & _
> objSoftware.Description & vbtab & _
> objSoftware.IdentifyingNumber & vbtab & _
> objSoftware.InstallDate2 & vbtab & _
> objSoftware.InstallLocation & vbtab & _
> objSoftware.InstallState & vbtab & _
> objSoftware.Name & vbtab & _
> objSoftware.PackageCache & vbtab & _
> objSoftware.SKUNumber & vbtab & _
> objSoftware.Vendor & vbtab & _
> objSoftware.Version
> Next
> objTextFile.Close
>
> Thank you very much !!
> Marcos


  Réponse avec citation
Vieux 26/11/2007, 18h33   #4
marcossoft
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Win32_Product query hangs when logged into Domain

"Jeffery Hicks [MVP]" wrote:

> WMI queries for this class are notoriously slow and resource intensive.

Thanks you are right ! I've wait a couple of minutes and the list was
displayed :-)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h22.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,42866 seconds with 12 queries