Ldap

Performs LDAP operations

Synopsis

Ldap <subcommand>

Subcommands

Command Description
add Adds an object to the directory
addcomputer Adds a computer account to the directory
addou Adds a new organizational unit
adduser Adds a new user
listsyntax Lists AD syntaxes
lspart Gets a list of partitions in the Active Directory forest
mod Modifies an object in the directory
moduser Modifies a directory entry
mountfs Mounts a directory as a file system
namedbits Prints the bits with symbolic names
query Queries the directory
rm Deletes an object from the directory
schema Gets the schema
search Searches the directory by name
timestamp Converts between the Active Directory timestamp value and a UTC date/time
watch Watches for changes to an object or subtree
whoami Gets the name of the authenticated user

For help on a subcommand, use Ldap <subcommand> -h

Ldap add

Adds an object to the directory

Synopsis

Ldap add [options] -ObjectClass <String> -ObjectName <String[]> <ServerName> <ObjectName> <ObjectClass>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create
-ObjectClass   <String> Object class of object to add

Options

Name Aliases Value Description
-Attributes   <AttributeChangeSpec[]> Attributes to set as name=value pars
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-ObjectClass   <String> Object class of object to add
-ObjectName   <String[]> Names or DNs of objects to create
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap addcomputer

Adds a computer account to the directory

Synopsis

Ldap addcomputer [options] -ObjectName <String[]> <ServerName> <ObjectName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create

Options

Name Aliases Value Description
-Attributes   <AttributeChangeSpec[]> Attributes to set as name=value pars
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-DisplayName   <String> Display name for user
-G, -Gc   <SwitchParam> Global Catalog server
-LogonName   <String> User name for auth requests
-M, -MemberOf   <String[]> Groups to make the user a member of
-NewPassword   <String> Password of new account
-ObjectName   <String[]> Names or DNs of objects to create
-Os   <String> Name of installed operating system
-OsVersion   <String> Version of installed operating system
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile
-UserCerts   <String[]> Names of files containing certificates to associate with the user

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap addou

Adds a new organizational unit

Synopsis

Ldap addou [options] -ObjectName <String[]> <ServerName> <ObjectName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create

Options

Name Aliases Value Description
-Attributes   <AttributeChangeSpec[]> Attributes to set as name=value pars
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-ObjectName   <String[]> Names or DNs of objects to create
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap adduser

Adds a new user

Synopsis

Ldap adduser [options] -ObjectName <String[]> <ServerName> <ObjectName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create

Options

Name Aliases Value Description
-Attributes   <AttributeChangeSpec[]> Attributes to set as name=value pars
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-DisplayName   <String> Display name for user
-Gc   <SwitchParam> Global Catalog server
-GivenName   <String> Given name (first name)
-LogonName   <String> User name for auth requests
-M, -MemberOf   <String[]> Groups to make the user a member of
-NewPassword   <String> Password of new account
-ObjectName   <String[]> Names or DNs of objects to create
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile
-Surname   <String> Surname (last name)
-UserCerts   <String[]> Names of files containing certificates to associate with the user

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap listsyntax

Lists AD syntaxes

Synopsis

Ldap listsyntax [options]

Options

Name Aliases Value Description
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-OutputFields   <String[]> Fields to display in output
      Possible values:
      EqualityContract
      syntaxKey
      memberName
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-H, -HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Details

A syntax describes the format of data within an attribute value and specifies how the raw bytes are decoded into the logical value.

Ldap lspart

Gets a list of partitions in the Active Directory forest

Synopsis

Ldap lspart [options] <ServerName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-F, -FollowReferrals   <SwitchParam> Follows referrals
-G, -Gc   <SwitchParam> Global Catalog server
-OutputFields   <String[]> Fields to display in output
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-PageSize   <Int32> Number of results to fetch per page
      Default: 100
-R, -RecordLimit   <Int32> Max number of records to return
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Details

This command queries all crossRef objects in the CN=Partitions container within the configuration NC.

Examples

Example 1 - List all partitions

Ldap lspart LUMON-DC1 -UserName marks@LUMON -Password She's@live!! -Kdc LUMON-DC1

Ldap mod

Modifies an object in the directory

Synopsis

Ldap mod [options] -ObjectName <String[]> <ServerName> <ObjectName> [ <Changes> ]

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create
-Changes   <AttributeChangeSpec[]> Changes to make as name?=value

Options

Name Aliases Value Description
-AllowOnBehalfOf   <String[]> Account name to add to msDS-AllowedToActOnBehalfOfOtherIdentity
-AuthProxy   <EndPoint> Endpoint of auth proxy
-Changes   <AttributeChangeSpec[]> Changes to make as name?=value
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-ObjectName   <String[]> Names or DNs of objects to create
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Examples

Example 1 - Add a certificate to an account

Ldap mod LUMON-DC1 -UserName milchick@LUMON -Password Br3@kr00m! ALLENTOWN$  userCertificate:file+=allentown.cer

This command authenticates as milchick, loads the certificate from the file allentown.cer, and associates it with the ALLENTOWN$ account.

Example 2 - Adding resource-based constrained delegate to a computer account

Ldap mod LUMON-DC1 -UserName milchick@LUMON -Password Br3@kr00m!  Stealth$ msDS-AllowedToDelegateTo+=HOST/ALLENTOWN, msDS-AllowedToDelegateTo+=cifs/ALLENTOWN

This command authenticates as milchick and allows the STEALTH$ account to delegate to ALLENTOWN for the cifs and host SPNs.

Ldap moduser

Modifies a directory entry

Synopsis

Ldap moduser [options] -ObjectName <String[]> <ServerName> <ObjectName> [ <Changes> ]

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create
-Changes   <AttributeChangeSpec[]> Changes to make as name?=value

Options

Name Aliases Value Description
-AllowOnBehalfOf   <String[]> Account name to add to msDS-AllowedToActOnBehalfOfOtherIdentity
-AuthProxy   <EndPoint> Endpoint of auth proxy
-Changes   <AttributeChangeSpec[]> Changes to make as name?=value
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-NewPassword   <String> New password (for password change or reset)
-ObjectName   <String[]> Names or DNs of objects to create
-OldPassword   <String> Old password (for password change)
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Details

Specify attribute changes as a series of name?=value pairs where ?= is:

+=   Add a value
-=   Remove a value
=    Replace all values

For example:

servicePrincipleName+=HOST/ALLENTOWN # Adds the SPN servicePrincipleName-=HOST/ALLENTOWN # Removes the SPN servicePrincipleName=HOST/ALLENTOWN # Replaces all SPNs

To add or remove multiple values, specify each value as a separate name?=value pair:

# Adds 3 SPNs servicePrincipleName+=HOST/ALLENTOWN servicePrincipleName+=cifs/ALLENTOWN

servicePrincipleName+=RestrictedKrbHost/ALLENTOWN

By default, the attribute values are parsed according to their syntax. For numeric attributes with bitflags, you may use the named bits, separating multiple bit names with a comma. For example, to set the encryption types for an account:

msDS-SupportedEncryptionTypes=Aes128CtsHmacSha1_96,Aes256CtsHmacSha1_96

Use the namedbits command to view a list of supported attributes with bitflags.

You may specify multiple operations for the same attribute within a single command line. Each operation is sent to the LDAP server as part of the modification request, in the order specified on the command line. Note that consecutive changes to the same attribute with the same operation are combined. IN the above example, all 3 SPNs are added in a single operation.

Ldap mountfs

Mounts a directory as a file system

Synopsis

Ldap mountfs [options] <ServerName> [ <Mountpoint> ]

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
<Mountpoint>   <String> Path of mountpoint in local filesystem

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-Gc   <SwitchParam> Global Catalog server
-Gid   <UInt32> GID of mount
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-R, -ReadWrite   <SwitchParam> Mount as read/write
-SearchBase   <LdapDistinguishedName> Name of root entry in directory to mount
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile
-Uid   <UInt32> UID of mount

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap namedbits

Prints the bits with symbolic names

Synopsis

Ldap namedbits [options] [ <Attribute> ]

Parameters

Name Aliases Value Description
<Attribute>   <String[]> Attribute(s) to print (default is all)

Options

Name Aliases Value Description
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-OutputFields   <String[]> Fields to display in output
      Possible values:
      EqualityContract
      Attribute
      Name
      Value
      HexValue
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-H, -HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap query

Queries the directory

Synopsis

Ldap query [options] <ServerName> [ <Filter> ]

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-Filter   <String> LDAP query

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-DirSync   <HexString> Only return changes since [cookie]
-E, -ExtendedDN   <SwitchParam> Request extended DNs
-Filter   <String> LDAP query
-FollowReferrals   <SwitchParam> Follows referrals
-G, -Gc   <SwitchParam> Global Catalog server
-IncludeDeleted   <SwitchParam> Includes delete items (but not recycled)
-IncludeDeletedLinks   <SwitchParam> Includes links to deleted items
-IncludeRecycled   <SwitchParam> Includes deleted and recycled items
-LinkTtl   <SwitchParam> Request link TTLs
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-PageSize   <Int32> Number of results to fetch per page
      Default: 100
-R, -RecordLimit   <Int32> Max number of records to return
-Scope   <LdapSearchScope> Scope of search
      Possible values:
      BaseObject
      Base
      SingleLevel
      WholeSubtree
      Subtree
-SearchBase   <LdapDistinguishedName[]> DN of search root (default is domain root)
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Details

Ldap query issues a query to an LDAP server. Use -OutputFields to specify the names of the attributes to retrieve; by default, only the DN of the entries is printed.

If no search base is provided, Ldap query uses the root of the domain.

-SearchBase supports these special names:

-Filter accepts an LDAP query. An LDAP query consists of one or more assertions of the form

(<attr> <op> <value>)

where <op> is one of: = (exact match, has attribute, or matches substring) ~= (approximate match) <= (less or equal) >= (greater or equal) &= (has all bits) (LDAP_MATCHING_RULE_BIT_AND) |= (has one or more bits) (LDAP_MATCHING_RULE_BIT_OR) *= (transitive match) (LDAP_MATCHING_RULE_TRANSITIVE_EVAL)

NOTE: Active Directory treats = and ~= the same, although the queries are represented differently on the wire. NOTE: &=, |=, and *= are extensions implemented by Active Directory.

To invert a filter and return objects that do not meet the criteria, prepend a !. For example, to return disabled accounts:

To query objects with an attribute, use =*. For example, to query objects with a servicePrincipalName, use:

(servicePrincipalName=*)

To combine multiple assertions, specify a & (all must match) or | (at least one must match) followed by multiple filter clauses, surrounding the entire expression with ( and ). For example:

(&amp;(attr1=value)(attr2=value)(attr3=value))

A few of the fields support named bits. Use the namedbits command for a list of supported attributes and bit names.

NOTE: Although not strictly required, it is a good idea to surround the filter with quotes to avoid having to escape special characters.

Examples

Example 1 - Find User with Logon Name ‘milchick’

Ldap query LUMON-DC1 '(samAccountName=milchick)' -OutputFields distinguishedName, objectSid

Example 2 - Find Objects with SPNs

Ldap query LUMON-DC1 '(servicePrincipalName=*)' -OutputFields distinguishedName, objectSid, servicePrincipalName

Example 3 - Query rootDse with no authentication

Ldap query LUMON-DC1 -OutputFields * -OutputStyle List

Example 4 - Query for accounts trusted for unconstrained delegation

Ldap query LUMON-DC1 -OutputFields * "(userAccountControl|=TrustedForDelegation)"

Example 5 - Query for accounts trusted for S4U2self

Ldap query LUMON-DC1 -OutputFields * "(userAccountControl|=TrustedForS4U2self)"

Example 6 - Query for accounts trusted for constrained delegation

Ldap query LUMON-DC1 -OutputFields * "(msDS-AllowedToDelegateTo=*)"

Ldap rm

Deletes an object from the directory

Synopsis

Ldap rm [options] -ObjectName <String[]> <ServerName> <ObjectName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-ObjectName   <String[]> Names or DNs of objects to create

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-ObjectName   <String[]> Names or DNs of objects to create
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap schema

Gets the schema

Synopsis

Ldap schema [options] <ServerName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-OutputFields   <String[]> Fields to display in output
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap search

Searches the directory by name

Synopsis

Ldap search [options] -SearchName <String[]> <ServerName> <SearchName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server
-SearchName   <String[]> Name to search for

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-DirSync   <HexString> Only return changes since [cookie]
-E, -ExtendedDN   <SwitchParam> Request extended DNs
-F, -FollowReferrals   <SwitchParam> Follows referrals
-G, -Gc   <SwitchParam> Global Catalog server
-IncludeDeleted   <SwitchParam> Includes delete items (but not recycled)
-IncludeDeletedLinks   <SwitchParam> Includes links to deleted items
-IncludeRecycled   <SwitchParam> Includes deleted and recycled items
-LinkTtl   <SwitchParam> Request link TTLs
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-PageSize   <Int32> Number of results to fetch per page
      Default: 100
-R, -RecordLimit   <Int32> Max number of records to return
-Scope   <LdapSearchScope> Scope of search
      Possible values:
      BaseObject
      Base
      SingleLevel
      WholeSubtree
      Subtree
-SearchBase   <LdapDistinguishedName[]> DN of search root (default is domain root)
-SearchName   <String[]> Name to search for
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Details

Ldap search uses the ANR feature of Active Directory to find objects where any designated name-like field begins with a search string.

To request items that match exactly (rather than those beginning with) a search term, prepend = to the search term.

Other substring searches (contains or begins with) are not supported; wildcards will be interpreted literally.

Note that these rules are observed and enforced by Active Directory; Ldap search merely sends what you give it.

Examples

Example 1 - Search for accounts beginning with admin

Ldap search admin

Example 2 - Search for accounts matching milchick exactly

Ldap search =milchick

Example 3 - Search using SSL (Kerberos)

Ldap search LUMON-DC1 -UserName marks@LUMON -Password She's@live!! -Kdc LUMON-DC1 -Ssl milchick

Example 4 - Search using SSL (NTLM)

Ldap search LUMON-DC1 -UserName marks@LUMON -Password She's@live!! -Ssl milchick

Ldap timestamp

Converts between the Active Directory timestamp value and a UTC date/time

Synopsis

Ldap timestamp [options] [ <TimestampOrDate> ]

Parameters

Name Aliases Value Description
<TimestampOrDate>   <String[]> Date or timestamp (as an integer) to convert

Options

Name Aliases Value Description
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-H, -HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Details

If the input is a number, it is converted to a date. The number may include the thousands separator, since the Active Directory is likely printed this way. The result is of the form 2026-03-17T17:38:42.2091265Z, which preserves the precision of the timestamp value.

If the input is a date, it is converted to a timestamp value, with the thousands separator. The date may be in any parsable format, such as 2026-03-17T17:38:42.2091265Z or 3/17/2026 5:38:42 PM, depending on your local culture settings. Note that some formats preserve more precision that others, and the resulting timestamp value reflects this.

You may specify multiple values. Each output record prints both the numeric value and the date/time so you know which record matches which input.

Examples

Example 1 - Convert a timestamp from AD

134,182,427,222,091,265

The value is converted to 2026-03-17T17:38:42.2091265Z

Example 2 -

"3/17/2026 5:38:42 PM"

The value is converted to 134,182,427,220,000,000. Dates of this format lack the precision of an Active Directory timestamp so the last several digits are 0.

Example 3 -

2026-03-17T17:38:42.2091265Z

The value is converted to 134,182,427,222,091,265

Example 4 - Multiple values

2026-03-17T17:38:42.2091265Z 134,182,427,220,000,000

Prints two records corresponding to the two inputs

Ldap watch

Watches for changes to an object or subtree

Synopsis

Ldap watch [options] <ServerName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-DirSync   <HexString> Only return changes since [cookie]
-E, -ExtendedDN   <SwitchParam> Request extended DNs
-F, -FollowReferrals   <SwitchParam> Follows referrals
-G, -Gc   <SwitchParam> Global Catalog server
-IncludeDeleted   <SwitchParam> Includes delete items (but not recycled)
-IncludeDeletedLinks   <SwitchParam> Includes links to deleted items
-IncludeRecycled   <SwitchParam> Includes deleted and recycled items
-LinkTtl   <SwitchParam> Request link TTLs
-OutputFields   <String[]> Fields to display in output
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-PageSize   <Int32> Number of results to fetch per page
      Default: 100
-R, -RecordLimit   <Int32> Max number of records to return
-Scope   <LdapSearchScope> Scope of search
      Possible values:
      BaseObject
      Base
      SingleLevel
      WholeSubtree
      Subtree
-SearchBase   <LdapDistinguishedName[]> DN of search root (default is domain root)
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages

Ldap whoami

Gets the name of the authenticated user

Synopsis

Ldap whoami [options] <ServerName>

Parameters

Name Aliases Value Description
<ServerName>   <String> Name of LDAP server

Options

Name Aliases Value Description
-AuthProxy   <EndPoint> Endpoint of auth proxy
-ConsoleOutputStyle -OutputStyle <OutputStyle> Determines the output style
      Possible values:
      Freeform
      Raw
      Table
      List
      Csv
      Tsv
      Json
      TreeTable
-Delegate   <SwitchParam> Requests delegation (sends TGT and key for Kerberos)
-G, -Gc   <SwitchParam> Global Catalog server
-OutputFields   <String[]> Fields to display in output
      Possible values:
      SaslString
      PrincipalName
      Kind
-OutputHeaders   <SwitchParam> Print headers for table/list/CSV/TSV styles
      Default: True
-Socks5   <host-or-ip:port> End point of SOCKS 5 server to use
-SpnOverride   <SpnMapping[]> Specifies an SPN override
-Ssl   <SwitchParam> Use SSL
-SslCert   <String> Name of PEM or PFX certificate file
-SslKeyFile   <String> Name of PFX file for SSL authentication
-SslKeyPassword   <String> Password for -SslCert or -SslKeyFile

Authentication

Name Aliases Value Description
-Anonymous   <SwitchParam> Uses anonymous login
-NtlmHash   <hexadecimal hash> NTLM hash for NTLM authentication
-Password -p <String> Password to authenticate with
-UserDomain -ud <String> Domain of user to authenticate with
-UserName -u <UserPrincipalName> User name to authenticate with, not including the domain

Authentication (Kerberos)

Name Aliases Value Description
-AesKey   <HexString> AES key (128 or 256)
-DelegateTicket   <String[]> Sends the tickets (and keys) to the target for delegation
-DesKey   <HexString> DES key
-Kdc   <host-or-ip:port> KDC endpoint
-Keytab   <String> Name of keytab file
-S4ProxyService   <SecurityPrincipalName> Name of service to proxy through
-S4UserCert   <String> Name of file containing a certificate of a user to impersonate with S4U
-S4UserName   <UserPrincipalName> Name of user to impersonate with S4U
-Tgt   <String> Name of file containing a ticket-granting ticket (.kirbi or ccache)
-TicketCache   <String> Name of ticket cache file
-Tickets -Ticket <String[]> Name of file containing service tickets (.kirbi or ccache)
-U2UserName   <UserPrincipalName> User name to request TGT for U2U
-UserCert   <String> Name of file containing user’s certificate (for PKINIT)
-UserKey   <String> Name of file containing user’s key (for PKINIT)
-UserKeyPassword   <String> Password to decrypt file containing user’s key (for PKINIT)

Authentication (NTLM)

Name Aliases Value Description
-NtlmVersion   <Version> NTLM version number (a.b.c.d)
-Workstation -w <String> Name of workstation to send with NTLM authentication

Connection

Name Aliases Value Description
-HostAddress -ha <String[]> Network address(es) of the server
-UseTcp4Only -4 <SwitchParam> Only use TCP over IPv4 endpoint
-UseTcp6Only -6 <SwitchParam> Only use TCP over IPv6 endpoint

Output

Name Aliases Value Description
-ConsoleLogFormat -LogFormat <LogFormat> Sets the format of log messages written to the console
      Default: 0
      Possible values:
      Text
      TextWithTimestamp
      Json
-DebugLog -vvv <SwitchParam> Prints debug messages
-Diagnostic -vv <SwitchParam> Prints diagnostic messages
-HumanReadable   <SwitchParam> Formats file sizes as human-readable values
-LogLevel   <LogMessageSeverity> Sets the lowest level of messages to log
      Possible values:
      Debug
      Diagnostic
      Verbose
      Info
      Warning
      Error
      Critical
-Verbose -V <SwitchParam> Prints verbose messages