Page 2 of 3 <123>
Topic Options
#203940 - 2011-12-15 05:13 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=46049&fpart=3
Top
#203941 - 2011-12-15 05:24 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Your link is broke...
Top
#203942 - 2011-12-15 05:34 PM Re: Printer mapping script not working in Windows 7 [Re: Allen]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
I am using ComputerInGroup to call the script that does the mapping.

 Code:
if ComputerInGroup('Printer Setup Group')=1
   call @ScriptDir+'\printers.kix'
endif


How do I use ComputerInGroup to enumerate all of the computer's group membership in my script?



http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=46049&fpart=1

Top
#203943 - 2011-12-15 05:37 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
I'm headed out... Maybe someone else can hop in here...
Top
#203944 - 2011-12-15 05:41 PM Re: Printer mapping script not working in Windows 7 [Re: Allen]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
May have found something to try.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=201892

Top
#203945 - 2011-12-15 05:46 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Same problem with EnumComputerinGroups. Only enumerates Domain Local groups on Windows 7.
Top
#203947 - 2011-12-15 07:25 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
You mind running a test vb script?

Got it from this sight, which describes some potential errors encountered when using the memberof function, which is what EnumComputerInGroups and ComputerInGroup uses.

http://www.rlmueller.net/MemberOf.htm

Not sure if it's helpful, but it's something.

 Code:
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.computername
Set objUser = GetObject("LDAP://" & strUserDN)
On Error Resume Next
arrGroups = objUser.GetEx("memberOf")
If (Err.Number <> 0) Then
    On Error GoTo 0
    Wscript.Echo "Member of no groups"
Else
    On Error GoTo 0
    For Each strGroup In arrGroups
        Wscript.Echo "Member of group " & strGroup
    Next
End If


Edited by ShaneEP (2011-12-15 07:27 PM)
Edit Reason: pasted wrong example...

Top
#203948 - 2011-12-15 07:32 PM Re: Printer mapping script not working in Windows 7 [Re: ShaneEP]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
ShaneEP:

Results of script:
ERROR : IDispatch pointers not allowed in expressions!
Script: X:\test.KIX
Line : 2

Top
#203949 - 2011-12-15 07:35 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Oops. Not a kix script.

Running it as a vb yields the domain local groups only.

Top
#203950 - 2011-12-15 07:38 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Well atleast we know its not a kix issue. Have your tried using WinNT instead of LDAP?
Top
#203951 - 2011-12-15 07:42 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Windows XP returns all groups, domain local and global.
Top
#203952 - 2011-12-15 07:46 PM Re: Printer mapping script not working in Windows 7 [Re: ShaneEP]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
This is what I am using:

 Code:
$WS = GetObject('WinNT://' + @domain + '/' + @wksta + '$$')

   for each $grp In $WS.Groups
      $GrpName = $grp.Name

Top
#203953 - 2011-12-15 08:02 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Oh yeah, sorry I missed that on the first page.

It just doesn't make much sense to me that it worked on XP and not Win7. I'm assuming nothing changed on the server side?


Edited by ShaneEP (2011-12-15 08:03 PM)

Top
#203954 - 2011-12-15 08:18 PM Re: Printer mapping script not working in Windows 7 [Re: ShaneEP]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
The script has not changed. Two pcs with same group membership.



XP results:
Workstation groups: ITS Computers
Workstation groups: Automatic Updates Computers
Workstation groups: Domain Computers
Workstation groups: Printer Setup Group
Workstation groups: A04_q-mis1
Workstation groups: Windows Updates Computers
Workstation groups: Printer Setup DL Group
Workstation groups: D04_q-mis2

Windows 7 results: (these are all Domain Local groups)
Workstation groups: Domain Computers
Workstation groups: D04_q-mis2
Workstation groups: Printer Setup DL Group

Top
#203956 - 2011-12-15 11:28 PM Re: Printer mapping script not working in Windows 7 [Re: tjcarst]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
I have not tested this, so there could be an bug or few. Try it out see what you get.

for each $group in GetADComputerGroups()
  ? $group
next
 

function GetADComputerGroups() dim $objSysInfo,$objcomputer,$groups,$group,$array[0],$i $computeringroup=0 $objSysInfo=CreateObject("ADSystemInfo") $objComputer=getobject("LDAP://" + $objSysinfo.computername) $Groups = $objComputer.GetEx("memberOf") for each $group in $groups redim preserve $array[$i] $array[$i]=GetObject("LDAP://" + $Group).cn $i=$i+1 next $GetADComputerGroups=$array endfunction

Top
#203957 - 2011-12-16 09:36 PM Re: Printer mapping script not working in Windows 7 [Re: Allen]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
Thank you, Allen.

I am home today fighting a crappy cold. I will test this on Monday and let you know results.

Top
#203958 - 2011-12-16 10:58 PM Re: Printer mapping script not working in Windows 7 [Re: Allen]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
On XP with Server 2003 AD this comes back empty for me Allen
Top
#203959 - 2011-12-16 11:01 PM Re: Printer mapping script not working in Windows 7 [Re: NTDOC]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Just to be sure, you have the computer (not user) in some groups?
Top
#203962 - 2011-12-19 08:19 AM Re: Printer mapping script not working in Windows 7 [Re: Allen]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Ah.. didn't even think about that Allen you're probably right. I may not have any stations in groups at this time. I did have at one point but think I've since removed them.

If I have time I'll add some and test it again.

Thanks

Top
#203963 - 2011-12-19 05:27 PM Re: Printer mapping script not working in Windows 7 [Re: NTDOC]
tjcarst Offline
Hey THIS is FUN

Registered: 2003-09-08
Posts: 243
Loc: USA
GetADComputerGroups on Win7 only retrieves Domain Local Groups too.
Top
Page 2 of 3 <123>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 433 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.074 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org