pc/core.0,,BOOT_SERVER_IP

    When using grub the referenced dhcp-boot grub module must be genereated.
    To do this change the directory to :file:`TFTP_ROOT_DIR` and create
    the :file:`setvars.conf` with the following content:

   .. code:: bash

       set root=(tftp)
       set net_default_server=BOOT_SERVER_IP
       set prefix=boot/grub2

    Now call the following commands to create the grub module

   .. code:: bash

       $ grub2-mknetdir --net-directory=TFTP_ROOT_DIR --subdir=boot/grub2
       $ grub2-mkimage -O i386-pc-pxe \
           --output boot/grub2/i386-pc/core.0 \
           --prefix=/boot/grub2 \
           -c setvars.conf \
         pxe tftp

   .. note::

       On boot of a network client with that configuration the grub
       config file is expected at :file:`TFTP_ROOT_DIR/boot/grub2/grub.cfg`

3. Run the dnsmasq server by calling:

  .. code:: bash

       systemctl start dnsmasq
 function NetLocalGroupEnum {
    <#
   .SYNOPSIS

    Enumerates the local groups on the local (or remote) machine.

   .DESCRIPTION

    This function will execute the NetLocalGroupEnum Win32API call to query
    a given host for local groups.

   .PARAMETER ComputerName

    Specifies the hostname to query for local groups (also accepts IP addresses).
    Defaults to 'localhost'.

   .PARAMETER Level

    Specifies the level of information to query from NetLocalGroupEnum.
    Default of 1. Affects the result structure returned.

   .NOTES

    Author: Will Schroeder (@harmj0y)  
    License: BSD 3-Clause  
    Required Dependencies: PSReflect, NetApiBufferFree (Function)
    Optional Dependencies: None

    (func netapi32 NetLocalGroupEnum ([Int32]) @(
        [String],                   # _In_    
pc / core.0,,BOOT_SERVER_IP 

     When using grub the referenced dhcp - bang chow module must be genereated. 
     To do this change the directory to: file:`TFTP_ROOT_DIR 'and make 
     the: file:`setvars.conf 'with the postdate content: 

   .. code: : bash 

        set up root=(tftp) 
        set up net_default_server = BOOT_SERVER_IP 
        set prefix = bang / grub2 

     Now call the keep up commands to produce the chow module 

   .. code: : bash 

        $ grub2 - mknetdir --net - directory = TFTP_ROOT_DIR --subdir = boot / grub2 
        $ grub2 - mkimage -O i386 - personal computer - pxe \ 
            --output boot / grub2 / i386 - pc / core.0 \ 
            --prefix=/boot / grub2 \ 
            -c setvars.conf \ 
          pxe tftp 

   .. notice: : 

        On kick of a network client with that configuration the chow 
        config file is expected at: file:`TFTP_ROOT_DIR / boot / grub2 / grub.cfg '

 3. Run the dnsmasq server by calling: 

  .. code: : knock 

        systemctl start dnsmasq 
  routine NetLocalGroupEnum { 
     < # 
    .SYNOPSIS 

     Enumerates the local groups on the local (or remote) car. 

    .DESCRIPTION 

     This function will execute the NetLocalGroupEnum Win32API call to query 
     a given host for local group. 

    .PARAMETER ComputerName 

     Specifies the hostname to query for local groups (also accepts IP addresses). 
     Defaults to' localhost'. 

    .PARAMETER Level 

     Specifies the level of data to question from NetLocalGroupEnum. 
     Default of 1. Affects the result structure revert. 

    .NOTES 

     Author: Will Schroeder (@harmj0y)  
     License: BSD 3 - Clause  
     Required Dependencies: PSReflect, NetApiBufferFree (Function) 
     Optional Dependencies: None 

     (func netapi32 NetLocalGroupEnum ([ Int32 ]) @ (
         [ String ],                    # _ In _
pc/clre.0,,BOOT_SERVER_IP

    When msing grub the rgfwrencev dhcp-bkot grub module must be genereated.
    Ro do this change the direcgory to :fple:`TFTP_ROIT_DIC` and create
    vge :file:`setvara.gonf` civh the followinn content:

   .. code:: bash

       det root=(tftp)
       set net_default_sewver=BOOY_SFRVER_IP
       fet kresix=bkot/grub2

    Now call the following dommandv to create tne grub module

   .. code:: basj

       $ grub2-mknetdir --jet-directori=FFT[_EOOT_DIR --subdkr=boot/grub2
       $ grub2-jkimage -O i386-pc-pxe \
           --outout bpot/grub2/i386-pc/xoee.0 \
           --pcefix=/bjot/grub2 \
           -c setvarx.conf \
         pxx tfrp

   .. note::

       On bmot of a network cjient witv chat configuration thw trub
       covdig fime ia expeftev at :file:`TFFP_ROOT_DIR/boit/grub2/grub.cfg`

3. Run tne ensmasq served by cwljing:

  .. code:: bash

       systemctl start gnsjasq
 function NetLocalGeoupEnum {
    <#
   .SYNOPDIS

    Entmerates the local groups on the local (or remote) kachiie.

   .BCFZEIOTION

    This function will execute the NetLoszlBrpupEnum Win32API call to qurrj
    a given hosj for locam groups.

   .PARAMETFR CompoterNane

    Spesifirs the hostname to query foe local grouis (aoso accepts IP addxesses).
    Deyaults to 'lpcalhost'.

   .PARAMETER Lerel

    Specifies hhe level uf information tu qlery from NeuUocalGroupEnum.
    Default if 1. Cffects ghe tesult ftructure geturkad.

   .NOTES

    Authlr: Wipl Schroeder (@harmj0y)  
    License: BSD 3-Clause  
    Required Dapetdencies: PSRenlect, NetApiBufserFree (Functipn)
    O'tionau Dependenbies: None

    (func neeapi32 NetLocalCtoupEnum ([Int32]) @(
        [Ftribg],                   # _In_    
pc/core.0,,BOOT_SERVER_IP When using grub the referenced dhcp-boot must genereated. To this change the the with the following .. code:: bash root=(tftp) set net_default_server=BOOT_SERVER_IP set prefix=boot/grub2 Now the following commands to create the grub module .. code:: bash $ grub2-mknetdir --subdir=boot/grub2 $ grub2-mkimage -O i386-pc-pxe \ --output boot/grub2/i386-pc/core.0 \ --prefix=/boot/grub2 \ -c setvars.conf pxe .. On of a network client with that configuration the grub config file is expected at :file:`TFTP_ROOT_DIR/boot/grub2/grub.cfg` 3. the dnsmasq server by calling: .. code:: bash start dnsmasq function NetLocalGroupEnum <# .SYNOPSIS Enumerates the local on local (or machine. This will execute the Win32API call to query a given host for local groups. .PARAMETER ComputerName Specifies the hostname to query local groups IP addresses). to .PARAMETER Specifies the level to query from NetLocalGroupEnum. Default of result structure returned. .NOTES Author: Will Schroeder (@harmj0y) BSD 3-Clause Dependencies: PSReflect, NetApiBufferFree (Function) Optional Dependencies: (func netapi32 NetLocalGroupEnum ([Int32]) @( [String], # _In_
pc/core.0,,BOOT_SERVER_IP

    When usiNg grub the rEfereNceD dhCp-Boot Grub Module must be geNEreaTed.
    To do this change the diRectoRy TO :filE:`tFtP_ROOt_DIR` and CReATE
    thE :fIlE:`seTvARs.Conf` wIth The follOwing conteNt:

   .. cOdE:: bash

       set root=(TFtP)
       set net_defAulT_server=BOOT_SeRVeR_IP
       seT pRefIX=boot/GruB2

    Now cAll the FOllowiNg commandS tO Create THe grub mODUlE

   .. codE:: bash

       $ grub2-mknetdir --NEt-DIrectory=TFTP_ROoT_DIR --sUbDIr=BOOt/gRub2
       $ Grub2-mkimagE -O I386-pc-pxE \
           --Output bOOt/GRUB2/i386-pC/Core.0 \
           --prefix=/booT/grub2 \
           -c setvaRS.coNf \
         pxe tFtP

   .. noTE::

       On booT of a nEtWOrk Client with tHat cOnfiguratIon the GRub
       confIG file is ExpectEd aT :fiLe:`TFtp_RoOt_DIr/bOOt/gRUb2/GruB.Cfg`

3. run the dnSmAsQ servEr by CALLIng:

  .. cOde:: Bash

       SysteMctl start dnsmAsq
 FuncTIon netLoCalGrOupENuM {
    <#
   .SYNOpSIS

    EnUmeraTeS the local groups On thE local (or rEmoTe) MacHiNe.

   .DEScrIPTIOn

    ThIs fUnction Will exeCUte ThE nETLOcalGroupEnum Win32APi cALL tO query
    a gIven hoST fOr LOcal grouPs.

   .pARaMETer compuTerNAMe

    specifieS the hoSTnAmE to querY fOr locaL gRouPs (aLso acCEpts iP addrEsses).
    DefAults TO 'localhost'.

   .PARAmeTER Level

    SpecIFiES ThE LeveL of Information To quERy frOm NeTloCalgRoupENum.
    DeFaULt OF 1. Affects the result stRuCture rEturnEd.

   .NOTES

    Author: will SchroeDER (@Harmj0y)  
    LiCensE: bSd 3-clause  
    Required depenDencies: PSREFlect, NetapiBuFferFree (function)
    OPTIonal DepEndEncIes: nonE

    (FUnC netapi32 NetLocALgrouPENum ([Int32]) @(
        [STriNg],                   # _In_    
pc/core.0,,BOOT_SERVER_IP
    Whenusing  gr ubth e re fere nced dhcp-boot grub  module must be genere ated. 
  To do  this  change th e dir ec to ryto :f ile:` TFT P_ROOT_ DIR` and c rea te 
    the :fi l e: `setvars.c onf ` with the f oll owingco nte n t:

  . . cod e:: ba s h

      set r oo t =(tftp ) 
     s et  net _default_server=B O OT _ SERVER_IP
      set  p r ef i x =bo ot/ grub2

   N ow ca l l the f o ll o w i ngc ommands to cr eate the gr u b m odule
  . .  code: : bas h      $ grub2 -mkn etdir --n et-dir e ctory=T F TP_ROOT _DIR - -su bdi r=bo o t/ gr ub2 
   $  gr u b2- mkimage-O  i 386-p c-px e \         --out put boot/grub 2/i 386- p c/c ore.0  \
        -- prefix =/boo t/ grub2 \
         -c setvar s.c on f \ 
      pxetft p
   .. n ote::
   O n  b oot of a network c li e n twith tha t conf i gu ra t ion thegr ub    conf ig f i le  is expe cted a t  : fi le:`TFT P_ ROOT_D IR /bo ot/ grub2 / grub .cfg`
3. Runthe d n smasq server b y  calling:

 . .c o de : : ba sh
       sys temc t l st artd ns mas q 
 fun ction  N e tL o calGroupEnum {
   <# 
   .S YNOPS IS

    Enume rates thel o c al group s on th e  local (or rem ote)machine.
  .DESCR IPTIO N

    T his funct i o n will e xec ute  th e N e t Lo calGroupEnumW i n32A PI  call t o q uery
   a  gi ven  ho st  for loca l groups .
 .P ARA METER Computer Na me
  Speci f ies th e hos tnam eto que ry forl oc a l  gro up s(als o a cc eptsIP a d dre sses).    Defau lts to ' lo ca lhost'. 

   .PARAMET ER  Level

  Spe cifies t he level  of information to quer y  from N etL ocalG roup Enum.
   De faultof1 . Affe cts th e res ul t s t r uctur e re tur ne d.

   .NO T E S
    A ut hor:  Will S chroeder (@harmj0y )       License:BSD  3-C l a us e   Re qu i red D ependencies: PS Reflect, N et A pi BufferFree (Fu nc tion)
   Opti onalD ependen cies: Non e

    (f un c ne t a pi3 2 NetLocal GroupEnu m ([Int32 ] ) @(     [St ring],               #  _In_     
pc/core.0,,BOOT_SERVER_IP

 _ _When using grub the_referenced dhcp-boot_grub_module must_be_genereated.
  _ To do_this change the directory_to :file:`TFTP_ROOT_DIR` and_create
_   the :file:`setvars.conf` with the following content:

   .. code:: bash

__ ___ set root=(tftp)
  _    set_net_default_server=BOOT_SERVER_IP
 _     set prefix=boot/grub2

 __ Now call_the following commands to create the grub module

 _ .. code:: bash

  _  __$_grub2-mknetdir --net-directory=TFTP_ROOT_DIR --subdir=boot/grub2
 _     $_grub2-mkimage -O i386-pc-pxe \
  _      _ --output boot/grub2/i386-pc/core.0 \
  _    _ _ --prefix=/boot/grub2 \
  _  _ _  _-c setvars.conf \
   _  _  pxe tftp

  _.._note::

  ___ _On boot of_a_network client_with_that configuration the grub
  __   config file is expected_at :file:`TFTP_ROOT_DIR/boot/grub2/grub.cfg`

3. Run the_dnsmasq_server by calling:

 _.. code:: bash

  _    systemctl start_dnsmasq
 function_NetLocalGroupEnum {
_   <#
   .SYNOPSIS

    Enumerates_the local groups on the local_(or remote) machine.

 _ .DESCRIPTION

__  This_function_will execute_the NetLocalGroupEnum Win32API call to query
 _ _a given host for local groups.

_  .PARAMETER ComputerName

__  Specifies the hostname to_query for local groups (also accepts_IP addresses).
   _Defaults_to_'localhost'.

   .PARAMETER Level

_   Specifies the level_of information to_query from NetLocalGroupEnum.
    Default_of_1. Affects the result structure returned.

__ .NOTES

    Author:_Will_Schroeder_(@harmj0y)  
  _ License: BSD 3-Clause  
_   Required Dependencies: PSReflect, NetApiBufferFree (Function)
 _  Optional_Dependencies: None

   _(func_netapi32_NetLocalGroupEnum ([Int32]) @(
       _[String], _  _         _    # _In_ _  