# # Command line arguments
function ParseCommandLine()
function Usage()
#########################################################
# # All errors are fatal by default unless there is anoter 'trap' with 'continue'
ParseCommandLine
write-host "" write-host "Effective settings:" write-host "" write-host " Forest: $ForestName" write-host " DC: $DCName" write-host " Type: $ObjectType" write-host " Name: $ObjectName" write-host " File: $OutFile" write-host ""
# # Set type specific variables
# # Build full DN for the object
# # Build list of attributes to display
if($null -ne $SchemaDE.mayContain)
if (-1 -eq $AttrList.IndexOf("displayName"))
if (-1 -eq $AttrList.IndexOf("flags"))
if ($ObjectType.ToLower().Equals("template") -and -1 -eq $AttrList.IndexOf("revision"))
$SB = New-Object System.Text.StringBuilder
# # Build command line and execute