Get-IvantiEmployee
SYNOPSIS
Retrieve an employee from Ivanti ITSM.
SYNTAX
RecID (Default)
Get-IvantiEmployee -RecID <String> [-top <Int32>] [-customFields <String>] [-allFields] [<CommonParameters>]
Search
Get-IvantiEmployee -search <String> -status <String> [-top <Int32>] [-customFields <String>] [-allFields]
[<CommonParameters>]
Get-IvantiEmployee -Email <String> [-top <Int32>] [-customFields <String>] [-allFields] [<CommonParameters>]
loginID
Get-IvantiEmployee -loginID <String> [-top <Int32>] [-customFields <String>] [-allFields] [<CommonParameters>]
Location
Get-IvantiEmployee -location <String> [-top <Int32>] [-customFields <String>] [-allFields] [<CommonParameters>]
OrganizationalUnit
Get-IvantiEmployee -OrganizationalUnit <String> [-top <Int32>] [-customFields <String>] [-allFields]
[<CommonParameters>]
NetworkUserName
Get-IvantiEmployee -NetworkUserName <String> [-top <Int32>] [-customFields <String>] [-allFields]
[<CommonParameters>]
DESCRIPTION
The `Get-Employee` function allows you to retrieve an employee from Ivanti ITSM. You can specify the employee using various parameters such as record ID, search, email, login ID, location, organizational unit, or network user name. The function also allows you to specify custom fields to include in the result and the maximum number of employees to retrieve.
EXAMPLES
EXAMPLE 1
Retrieves the employee with the record ID 'abc123'.
EXAMPLE 2
Retrieves employees matching the search string 'John Doe'.
EXAMPLE 3
Get-Employee -Email '[email protected]'
Retrieves the employee with the email 'john.doe@example.com'.
EXAMPLE 4
Retrieves the employee with the login ID 'jdoe'.
EXAMPLE 5
Retrieves the employee with the network user name 'jdoe'.
EXAMPLE 6
Retrieves employees in the 'IT' organizational unit.
PARAMETERS
-RecID
The record ID of the employee to retrieve. This parameter is mandatory when using the 'RecID' parameter set.
Type: String
Parameter Sets: RecID
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-search
A search string to apply when retrieving the employee. This parameter is mandatory when using the 'Search' parameter set.
Type: String
Parameter Sets: Search
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The email of the employee to retrieve. This parameter is mandatory when using the 'Email' parameter set.
Type: String
Parameter Sets: Email
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-loginID
The login ID of the employee to retrieve. This parameter is mandatory when using the 'loginID' parameter set.
Type: String
Parameter Sets: loginID
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-location
The location of the employee to retrieve. This parameter is mandatory when using the 'Location' parameter set.
Type: String
Parameter Sets: Location
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OrganizationalUnit
The organizational unit of the employee to retrieve. This parameter is mandatory when using the 'OrganizationalUnit' parameter set.
Type: String
Parameter Sets: OrganizationalUnit
Aliases: OrgUnit
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NetworkUserName
The network user name of the employee to retrieve. This parameter is mandatory when using the 'NetworkUserName' parameter set.
Type: String
Parameter Sets: NetworkUserName
Aliases: SamAccountName
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-status
The status of the employee to retrieve. Valid values are 'Active', 'Terminated', and 'On Leave'. The default value is 'Active'.
Type: String
Parameter Sets: Search
Aliases:
Required: True
Position: Named
Default value: Active
Accept pipeline input: False
Accept wildcard characters: False
-top
The maximum number of employees to retrieve.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-customFields
Custom fields to include in the retrieved employee.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-allFields
A switch to include all fields in the retrieved employee.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
This function is useful for retrieving employee records from Ivanti ITSM.
RELATED LINKS
https://docs.microsoft.com/en-us/powershell/scripting/overview