Convert-OUString
SYNOPSIS
Converts a DN string to a PSCustomObject or hashtable.
SYNTAX
1 2 |
|
DESCRIPTION
The Convert-OUString function takes a string and splits it according to the specification of an LDAP DN as contained in RFC 4514. Each RDN (name-value pair) is added to the returning object with nameNumber as name and value as the value.
The DN 'uid=johnDoe,ou=People,dc=example,dc=com' will result in a PSCustomObject or hashtable with following properties and values.
- dc1 : com
- dc2 : example
- ou1 : People
- uid1 : johnDoe
- OUPath : ou=People,dc=example,dc=com
The Convert-OUString function also adds a property named 'OUPath' with the full DN up to the last (when reading from right to left) RDN.
EXAMPLES
EXAMPLE 1
1 2 3 4 5 6 7 8 9 |
|
In this example we are converting a DN to a hashtable.
EXAMPLE 2
1 2 3 4 5 6 7 |
|
In this example we are converting a DN to a PSCustomObject.
PARAMETERS
-AsPSCustomObject
Tells the function to return a PSCustomObject instead of a hashtable
1 2 3 4 5 6 7 8 9 |
|
-OUString
String to convert
1 2 3 4 5 6 7 8 9 |
|
-ProgressAction
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.
The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.
1 2 3 4 5 6 7 8 9 |
|
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.