Extended Object : Display Actual Applied Computer GPO

Version 2
    Share:|

    Display GPO name ( Policy name ) actual applied to an Windows Server.

    ......................................................

     

    Extended Oject command line :

               runscript -NH -h ??TARGET.NAME?? -e /BMC_Storage/extended_objects/Windows_Applied_Computer_GPO.nsh "??TARGET.NAME??" "??TARGET.STAGING_DIR??"

     

     

     

    Windows_Applied_Computer_GPO.nsh

    ...........................................................

     

    #

    # Create VB Script on TARGET

    #

     

    echo "
    strComputer = \".\"
    Set locator = CreateObject(\"WbemScripting.SWbemLocator\")
    Set rsopProv = locator.ConnectServer(strComputer, \"root\\\rsop\\Computer\", null, null, Null, Null, 0 , Null)
    Set colItems = rsopProv.ExecQuery(\"Select * from RSOP_GPO\")For Each objItem in colItems
        Wscript.Echo objItem.name
        ' Wscript.Echo \"Name\" & objItem.name
        ' Wscript.Echo \"Enable        : \" & objItem.enabled
        ' Wscript.Echo \"accessDenied  : \" & objItem.accessDenied
        ' Wscript.Echo \"fileSystemPath: \" & objItem.fileSystemPath
        ' Wscript.Echo \"filterAllowed : \" & objItem.filterAllowed
        ' Wscript.Echo \"filterId      : \" & objItem.filterId
        ' Wscript.Echo \"guidName      : \" & objItem.guidName
        ' Wscript.Echo \"id            : \" & objItem.id
        ' Wscript.Echo \"version       : \" & objItem.version
        ' Wscript.Echo

    Next
    " > ${staging_directory}/Windows_Applied_Computer_GPO.vbs

    cd $staging_directory
    nexec $target_name cscript //nologo Windows_Applied_Computer_GPO.vbs | tr -d '\r'

    rm -f Windows_Applied_Computer_GPO.vbs

    .........................................

     

    Script Above have been alter. to simply include minimal information.

     

    Enjoy !