Hey Guys,



in:

http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1203.mspx

you have postet a worthwhile Scriptpart.



I've tried to adapt it to my needs.



But I get an Error, that this is a to complex Query.

So I've tried it with your Scriptomatic, but the result was the same error

"wbemErrProviderNotCapable 2147749924 0x80041024"



Here is what I try to do:



strComputer = "."

Set objWMIDienst = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")



Set colKonten = objWMIDienst.ExecQuery _

("SELECT * FROM Win32_SID", "WQL", _

wbemFlagReturnImmediately + wbemFlagForwardOnly)



For Each objKonto in colKonten

Wscript.Echo objKonto.AccountName

Wscript.Echo objKonto.ReferencedDomainName

Next



Can you help me out a little?

Re: Determine SID by JHP

JHP
Wed Apr 12 11:55:09 CDT 2006

Do you set the Constants?

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

Otherwise look at the following:

http://www.activexperts.com/activmonitor/windowsmanagement/wmi/samples/os/#Win32_SID.htm

http://www.dx21.com/SCRIPTING/WMI/SUBCLASS.ASP?CID=343

HTH

"StefanP" <greenthumb@NOSPAMweb.de> wrote in message
news:uX65S3kXGHA.4620@TK2MSFTNGP04.phx.gbl...
> Hey Guys,
>
>
>
> in:
>
> http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1203.mspx
>
> you have postet a worthwhile Scriptpart.
>
>
>
> I've tried to adapt it to my needs.
>
>
>
> But I get an Error, that this is a to complex Query.
>
> So I've tried it with your Scriptomatic, but the result was the same error
>
> "wbemErrProviderNotCapable 2147749924 0x80041024"
>
>
>
> Here is what I try to do:
>
>
>
> strComputer = "."
>
> Set objWMIDienst = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
>
>
>
> Set colKonten = objWMIDienst.ExecQuery _
>
> ("SELECT * FROM Win32_SID", "WQL", _
>
> wbemFlagReturnImmediately + wbemFlagForwardOnly)
>
>
>
> For Each objKonto in colKonten
>
> Wscript.Echo objKonto.AccountName
>
> Wscript.Echo objKonto.ReferencedDomainName
>
> Next
>
>
>
> Can you help me out a little?
>
>
>



Re: Determine SID by StefanP

StefanP
Thu Apr 13 05:33:00 CDT 2006

Yes Id did set the Constants.
And the scriptsample behinde the first link brings up the same error.
BTW: Tested on serveral and different PCs...

"JHP" <goawayspam@GFY.com> schrieb im Newsbeitrag
news:%23Ew$AHlXGHA.3760@TK2MSFTNGP02.phx.gbl...
> Do you set the Constants?
>
> Const wbemFlagReturnImmediately = &h10
> Const wbemFlagForwardOnly = &h20
>
> Otherwise look at the following:
>
> http://www.activexperts.com/activmonitor/windowsmanagement/wmi/samples/os/#Win32_SID.htm
>
> http://www.dx21.com/SCRIPTING/WMI/SUBCLASS.ASP?CID=343
>
> HTH
>
> "StefanP" <greenthumb@NOSPAMweb.de> wrote in message
> news:uX65S3kXGHA.4620@TK2MSFTNGP04.phx.gbl...
>> Hey Guys,
>>
>>
>>
>> in:
>>
>> http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1203.mspx
>>
>> you have postet a worthwhile Scriptpart.
>>
>>
>>
>> I've tried to adapt it to my needs.
>>
>>
>>
>> But I get an Error, that this is a to complex Query.
>>
>> So I've tried it with your Scriptomatic, but the result was the same
>> error
>>
>> "wbemErrProviderNotCapable 2147749924 0x80041024"
>>
>>
>>
>> Here is what I try to do:
>>
>>
>>
>> strComputer = "."
>>
>> Set objWMIDienst = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
>>
>>
>>
>> Set colKonten = objWMIDienst.ExecQuery _
>>
>> ("SELECT * FROM Win32_SID", "WQL", _
>>
>> wbemFlagReturnImmediately + wbemFlagForwardOnly)
>>
>>
>>
>> For Each objKonto in colKonten
>>
>> Wscript.Echo objKonto.AccountName
>>
>> Wscript.Echo objKonto.ReferencedDomainName
>>
>> Next
>>
>>
>>
>> Can you help me out a little?
>>
>>
>>
>
>