1. OG_Logon-hours

    Article: AN0001777Updated: 19.05.2020

    This function returns a list of enabled logon of users in particular days in week from LDAP (Microsoft Active Directory) according to configuration. The created file can be used for import into model IT and map to the entity MS AD user according to SID. Then times of enabled logon of particular users can be seen in model IT.

    Main prerequisites for use

    Prerequisite Description

    Module Active Directory PowerShell Microsoft

    In order to read information about users from LDAP it is necessary to install Powershell module for Active Directory.
    Remote Differential Compression In order to read information about users from LDAP it is necessary to enable this function of the Windows system on server executing this functionality.
    AD DS and AD LDS Tools In order to read information about users from LDAP it is necessary to enable this function of the Windows system on server executing this functionality.
    Powershell v3 Microsoft Powershell version 3 or higher.

    Description

    Function creates a text file containing information about enabled logon of users according to configuration. The file contains following information.

     

    Column heading Description
    SamAccountName User login. E.g. altman
    Displayname User displayed name.
    SurName User surname.
    GivenName User first name.
    Day Day in week. 1=Monday...7=Sunday
    LogonHours (0-23)UTC Enabled logon hours 0-23 in UTC. 1=Enabled logon, 0=Disabled logon.
    SID User account SID.

    Parameters

    Include hereinafter stated parameters in the file og_configuration.ps1 (generic parameters shared with other functions) or in the file OG_PC-Start.config (specific parameters of this function). Parameter configuration is described in the documentation of the programme Piklo.

      

     

    Parameter Description Example
    [string]$LogFile Path to the file, in which log of the function shall be stored. [string]$LogFile = "\\servername\OGoutput\AD-Users\LogFile.txt"
    [string]$OutFile Path to the file, in which output of the function shall be stored.

    [string]$OutFile = "\\servername\OGoutput\AD-Users\OutFile.txt"

    [string]$OutFileEncoding Coding of the output file. Possible options are "UTF8", "Unicode" and "DEFAULT". The value "DEFAULT" makes the file being created in the ANSI encoding.

    [string]$OutFileEncoding = "UTF8"

    [string]$Delimiter Value separator in the records. Possible values are: "t" - tab, ";" - semicolon a "," - comma.

    [string]$Delimiter = "t"

    [string]$HeaderOutFile

    Defines, wheather the output file shall include header with column names ("1") or not ("0").

    [string]$HeaderOutFile = "1"

    [string]$WorkFilePath Path to a working directory.

    [string]$WorkFilePath = "\\servername\OGtemp"

     

    Call

    The function is called by means of the programme Piklo, that is part of ObjectGears package, from ObjectGears script. Result of the call has to be assigned to a variable, with which the script can further work.

    a = OG.Process.RunPiklo('OG_Logon-hours','-type C')

×