Search found 13929 matches

by jvierra
Thu May 08, 2008 11:38 am
Forum: VBScript
Topic: Assign WMI value to variable
Replies: 7
Views: 2839

Assign WMI value to variable

For WMI queries you need to appraoach it this wayL: strComputer = "." Set objWMIService = GetObject("winmgmts:" & strComputer & "rootCIMV2") Set systems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") For Each system In systems     strModel = system.Model Next WScript.Echo "The model...
by jvierra
Wed May 07, 2008 4:31 pm
Forum: VBScript
Topic: Assign WMI value to variable
Replies: 7
Views: 2839

Assign WMI value to variable

Simple assignment

myvar = 1
myvar= 2
myvar = "mystring"

Simple assignment with object property

myvar = obj.Model

FOr your case ---

strModel = object.Model

by jvierra
Wed May 07, 2008 4:57 am
Forum: VBScript
Topic: Large Group Problem
Replies: 10
Views: 5962

Large Group Problem

For clarity here is an example: GetGroupMembers "LDAP://cn=mygroup,ou=company groups,dc=mydomain,dc=com" This will display all of the diret members of the requested group. It may throw an error with included groups and has not been designed to detect them. The example was converted a long time ago (...
by jvierra
Wed May 07, 2008 4:42 am
Forum: VBScript
Topic: Large Group Problem
Replies: 10
Views: 5962

Large Group Problem

When you are using "aDSPath" you are using the "LDAP" access. The aDsPath is in teh form of LDAP://cn=xxx,dc=yyyu,dc=zz Using "GetObject" the AcriveX/COM subsystem sees teh "LDAP:" as a special situation similar to "COM1:" and "LPT1:". These are reserved syntaxes inthis case and let the Windows syst...
by jvierra
Wed May 07, 2008 3:32 am
Forum: VBScript
Topic: Large Group Problem
Replies: 10
Views: 5962

Large Group Problem

I am starting to round up all of my notes on this: THe foolowing is from : http://msdn.microsoft.com/en-us/library/ms676302.aspx The version of the server that supplies the requested data determines the maximum number of values that can be retrieved in a single query. The following table lists the s...
by jvierra
Tue May 06, 2008 1:26 pm
Forum: VBScript
Topic: Large Group Problem
Replies: 10
Views: 5962

Large Group Problem

Here is one example: Const increment = 1000 Function GetGroupMembers(aDSPath)     Dim adsi     Dim group, members, member     Dim lowRange, highRange         lowRange = 0     highRange = increment - 1         Set adsi = GetObject(aDSPath)         While Not bDone             strRange = "member;range=...
by jvierra
Tue May 06, 2008 6:45 am
Forum: VBScript
Topic: Large Group Problem
Replies: 10
Views: 5962

Large Group Problem

Yes - there is a limit of 1000 items per query by default on AD. You need to select them in ranges. I will look into the online docs for the discussion of how to get around this limit. I don't have a working example at hand. YOu could also look in MSDN lib for "AD query limit" - I thnk that will ret...
by jvierra
Fri May 02, 2008 5:01 am
Forum: VBScript
Topic: Logon Script does not create instance of HTA
Replies: 17
Views: 10306

Logon Script does not create instance of HTA

User interaction during logon from USERINIT may be a problem. YOu have no control over when the script is executed. It may be executed before all components are completely initilized. Try setting GP to run script "sync". The run "async" by default. Sometimes this can help. Look in GP logs and/or tur...
by jvierra
Thu May 01, 2008 8:30 am
Forum: VBScript
Topic: DNS Search
Replies: 2
Views: 787

DNS Search

Using "WHERE DnsServerName = 'myhostname'" as a query filter will work to isolate one or more host names. You need to do the IP outside of the query because a string match won't behave as expected in the WHERE clause. YOu can use a single IP in teh WHERE clause and you can use WHERE ip > '192' AND I...
by jvierra
Thu May 01, 2008 3:39 am
Forum: VBScript
Topic: DNS Search
Replies: 2
Views: 787

DNS Search

Sorry - I don't see how it can be done with a filter. This may be what you are looking for: strComputer = "." Set objWMIService = GetObject("winmgmts:" & strComputer & "rootMicrosoftDNS") Set colItems = objWMIService.ExecQuery("Select * from MicrosoftDNS_AType") For Each objItem in colItems     matc...