Page 1 of 1 1
Topic Options
#175728 - 2007-04-26 07:26 PM GPO version stuff...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I found some stuff on GPOs and wanted to try them out.
had 2 issues though.
first, the date information is way of. this script says my GPO is from 1980!
and it does not work for root/rsop/user.
dunno why.
any takers?
 Code:
$=SetOption("wrapateol","on")
$dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
 
$strComputer = "."
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\rsop\Computer")


For Each $objItem in $objWMIService.ExecQuery("Select * from RSOP_Session")
    ? "ID: " $objItem.ID
    $dtmConvertedDate.Value = $objItem.CreationTime
    ? "Creation Time: " $dtmConvertedDate.GetVarDate
    ? "Flags: " $objItem.Flags
    For Each $strSecurityGroup in $objItem.SecurityGroups
        ? "Security group: "  $strSecurityGroup
    Next
    ? "Site: " $objItem.Site
    ? "Slow Link: " $objItem.SlowLink
    ? "SOM: " $objItem.SOM
    ? "Target Name: " $objItem.TargetName
    ? "TTL (Minutes): " $objItem.TTLMinutes
    ? "Version: " $objItem.Version
Next
?

get $


and here is the source of it all:
http://www.activexperts.com/activmonitor/windowsmanagement/scripts/grouppolicy/
_________________________
!

download KiXnet

Top
#175742 - 2007-04-27 08:41 AM Re: GPO version stuff... [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Results are fine here:

ID: Session1
Creation Time: 6-12-2006 19:25:32
Flags: 0

Top
#175746 - 2007-04-27 12:39 PM Re: GPO version stuff... [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
did you try with the user-branch?

I couldn't get any results with it.
_________________________
!

download KiXnet

Top
#175759 - 2007-04-27 03:53 PM Re: GPO version stuff... [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
User doesn't work for me either unless I'm interpreting it wrong:
 Code:
$strComputer = @userid
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\rsop\User")


Top
#175762 - 2007-04-27 04:17 PM Re: GPO version stuff... [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no, string computer is always computer.
it's the way wmi works. it always points to computer. either local or remote.

but, looking at ms site, it might be that you need to add @sid after rsop\User\"


anyway, none of the combinations worked for me for the user branch.
might be one of the things that were never ment to really work...
just like vista.
_________________________
!

download KiXnet

Top
#175763 - 2007-04-27 04:24 PM Re: GPO version stuff... [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Yeah I specified the $strComputer as "." and @WKSTA and as the "ServerName".
None worked, thats why I tried @USERID as a last ditch effort.

Not much stuff to find about root\rsop\user anyway though. Nothing concerning VBS or KIX.

Top
#175768 - 2007-04-27 05:29 PM Re: GPO version stuff... [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Tried with the SID as well, none of the combinations worked out for me neither. At first I didn't even know about the @SID macro so I wrote my own Name2SID UDF :P

Anyway I'll make it with optional username and network value's.

Top
#175783 - 2007-04-28 09:48 AM Re: GPO version stuff... [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmmm...

what's wrong with the old name2sid() udf?
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84323
_________________________
!

download KiXnet

Top
#175785 - 2007-04-28 02:22 PM Re: GPO version stuff... [Re: Lonkero]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Maybe it is just a different way? Your function returns an error code if something goes wrong.
Top
#175788 - 2007-04-28 06:53 PM Re: GPO version stuff... [Re: Witto]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
looking at the udf, it will only return the SID as return value.
error can be checked via @error

the header of the udf just isn't correct on that.
_________________________
!

download KiXnet

Top
#175798 - 2007-04-29 12:21 PM Re: GPO version stuff... [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Originally Posted By: Jooel
hmmm...

what's wrong with the old name2sid() udf?
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84323


Hmmm I did look at kixtart.org/udf and couln't find it there so I decided to post my own.

Top
#175800 - 2007-04-29 03:21 PM Re: GPO version stuff... [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
look again \:\)
it's right next to yours ;\)
_________________________
!

download KiXnet

Top
#175821 - 2007-04-30 05:37 PM Re: GPO version stuff... [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Oh well, starts to look like an annual thing to do for me ;\)
Top
Page 1 of 1 1


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

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.078 seconds in which 0.039 seconds were spent on a total of 13 queries. Zlib compression enabled.

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