en-us/SidCloner.dll-Help.xml

<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
  <command:details>
    <command:name>Copy-Sid</command:name>
    <maml:description>
      <maml:para>
        Copies SID from one account to SID History of other account in different domain
      </maml:para>
    </maml:description>
    <maml:copyright>
      <maml:para/>
    </maml:copyright>
    <command:verb>Copy</command:verb>
    <command:noun>Sid</command:noun>
    <dev:version/>
  </command:details>
  <maml:description>
    <maml:para>
      This command allows copying of SID to SID History of other account in different AD domain. Typically used in AD forest consolidation / migration scenarios.
    </maml:para>
  </maml:description>
  <command:syntax>
    <command:syntaxItem>
      <maml:name>Copy-Sid</maml:name>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)">
        <maml:name>Identities</maml:name>
        <maml:description>
          <maml:para>
            Object that is required to have SourcePrincipal and TargetPrincipal filled in and containing sAMAccountName of source and target principal used to copy the SID from/to.
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0">
        <maml:name>SourceDomain</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of AD domain hosting SourcePrincipal
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
        <maml:name>TargetDomain</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of AD domain hosting TargetPrincipal
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
        <maml:name>SourceDc</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of domain controller to be used for operation in SourceDomain. If not specified, command will try to discover suitable DC
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="3">
        <maml:name>TargetDc</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of domain controller to be used for operation in TargetDomain. If not specified, command will try to discover suitable DC
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="4">
        <maml:name>SourceCredential</maml:name>
        <maml:description>
          <maml:para>
            Credential to authorize operation is source domain. Recommended form of username is Domain\User
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="5">
        <maml:name>TargetCredential</maml:name>
        <maml:description>
          <maml:para>
            Credential to authorize operation is target domain. Recommended form of username is Domain\User
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
      </command:parameter>
    </command:syntaxItem>
    <command:syntaxItem>
      <maml:name>Copy-Sid</maml:name>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false">
        <maml:name>SourcePrincipal</maml:name>
        <maml:description>
          <maml:para>Source of SID</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false">
        <maml:name>TargetPrincipal</maml:name>
        <maml:description>
          <maml:para>Receiver of SID from SourcePrincipal</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0">
        <maml:name>SourceDomain</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of AD domain hosting SourcePrincipal
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
        <maml:name>TargetDomain</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of AD domain hosting TargetPrincipal
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
        <maml:name>SourceDc</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of domain controller to be used for operation in SourceDomain. If not specified, command will try to discover suitable DC
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="3">
        <maml:name>TargetDc</maml:name>
        <maml:description>
          <maml:para>
            DNS Name of domain controller to be used for operation in TargetDomain. If not specified, command will try to discover suitable DC
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="4">
        <maml:name>SourceCredential</maml:name>
        <maml:description>
          <maml:para>
            Credential to authorize operation is SourceDomain. Recommended form of username is Domain\User
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="5">
        <maml:name>TargetCredential</maml:name>
        <maml:description>
          <maml:para>
            Credential to authorize operation is target domain. Recommended form of username is Domain\User
          </maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
      </command:parameter>
    </command:syntaxItem>
  </command:syntax>
  <command:parameters>
    <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)">
      <maml:name>Identities</maml:name>
      <maml:description>
        <maml:para>
          Object that is required to have SourcePrincipal and TargetPrincipal filled in and containing sAMAccountName of source and target principal used to copy the SID from/to.
        </maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
      <dev:type>
        <maml:name>PSObject</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false">
      <maml:name>SourcePrincipal</maml:name>
      <maml:description>
        <maml:para>Source of SID</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      <dev:type>
        <maml:name>String</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false">
      <maml:name>TargetPrincipal</maml:name>
      <maml:description>
        <maml:para>Receiver of SID from SourcePrincipal</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      <dev:type>
        <maml:name>String</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0">
      <maml:name>SourceDomain</maml:name>
      <maml:description>
        <maml:para>DNS Name of AD domain hosting SourcePrincipal</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      <dev:type>
        <maml:name>String</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
      <maml:name>TargetDomain</maml:name>
      <maml:description>
        <maml:para> DNS Name of AD domain hosting TargetPrincipal</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      <dev:type>
        <maml:name>String</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
      <maml:name>SourceDc</maml:name>
      <maml:description>
        <maml:para>DNS Name of domain controller to be used for operation in SourceDomain. If not specified, command will try to discover suitable DC</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      <dev:type>
        <maml:name>String</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="3">
      <maml:name>TargetDc</maml:name>
      <maml:description>
        <maml:para>DNS Name of domain controller to be used for operation in TargetDomain. If not specified, command will try to discover suitable DC</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
      <dev:type>
        <maml:name>String</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="4">
      <maml:name>SourceCredential</maml:name>
      <maml:description>
        <maml:para>Credential to authorize operation is SourceDomain. Recommended form of username is Domain\User</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
      <dev:type>
        <maml:name>PSCredential</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
    <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="5">
      <maml:name>TargetCredential</maml:name>
      <maml:description>
        <maml:para>Credential to authorize operation is TargetDomain. Recommended form of username is Domain\User</maml:para>
      </maml:description>
      <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
      <dev:type>
        <maml:name>PSCredential</maml:name>
        <maml:uri/>
      </dev:type>
      <dev:defaultValue/>
    </command:parameter>
  </command:parameters>
  <command:inputTypes>
    <command:inputType>
      <dev:type>
        <maml:name>System.String</maml:name>
        <maml:uri/>
        <maml:description/>
      </dev:type>
      <maml:description>
        <maml:para/>
      </maml:description>
    </command:inputType>
    <command:inputType>
      <dev:type>
        <maml:name>System.Management.Automation.PSCustomObject</maml:name>
        <maml:uri/>
        <maml:description/>
      </dev:type>
      <maml:description>
        <maml:para/>
      </maml:description>
    </command:inputType>
    <command:inputType>
      <dev:type>
        <maml:name>System.Management.Automation.PSCredential</maml:name>
        <maml:uri/>
        <maml:description/>
      </dev:type>
      <maml:description>
        <maml:para/>
      </maml:description>
    </command:inputType>
  </command:inputTypes>
  <command:returnValues>
    <command:returnValue>
      <dev:type>
        <maml:name>GreyCorbel.CloneResult</maml:name>
        <maml:uri/>
        <maml:description/>
      </dev:type>
      <maml:description>
        <maml:para/>
      </maml:description>
    </command:returnValue>
  </command:returnValues>
  <command:terminatingErrors/>
  <command:nonTerminatingErrors/>
  <maml:alertSet>
    <maml:title/>
    <maml:alert>
      <maml:para>
        Caller (or credential provided) has to be member of Administrators or Domain Admins group in respective AD domain.
      </maml:para>
    </maml:alert>
    <maml:alert>
      <maml:para>
        Configuration of Source and Target domains must fulfill requirements specified for DsAddSidHistory Windows API
      </maml:para>
    </maml:alert>
  </maml:alertSet>
  <command:examples>
    <command:example>
      <maml:title>
        -------------------------- Example 1 --------------------------
      </maml:title>
      <maml:introduction>
        <maml:paragraph>PS C:\></maml:paragraph>
      </maml:introduction>
      <dev:code>
        $sourceCred=Get-Credential
        $targetCred=Get-Credential
 
        Import-Csv .\inputFile.csv | Copy-Sid -SourceDomain domain1.com -TargetDomain domain2.com -SourceCredential $sourceCred -TargetCredential $targetCred
      </dev:code>
      <dev:remarks>
        <maml:para>
          Clones SIDs of accounts in inputFile.csv from domain1.com to accounts in domain2.com
        </maml:para>
        <maml:para/>
        <maml:para/>
        <maml:para/>
      </dev:remarks>
      <command:commandLines>
        <command:commandLine>
          <command:commandText>
            <maml:para/>
          </command:commandText>
        </command:commandLine>
      </command:commandLines>
    </command:example>
    <command:example>
      <maml:title>
        -------------------------- Example 2 --------------------------
      </maml:title>
      <maml:introduction>
        <maml:paragraph>PS C:\></maml:paragraph>
      </maml:introduction>
      <dev:code>
        $sourceCred=Get-Credential
        $targetCred=Get-Credential
        Copy-Sid -SourceDomain domain1.com -TargetDomain domain2.com -SourceCredential $sourceCred -TargetCredential $targetCred -SourcePrincipal user1 -TargetPrincipal user1
      </dev:code>
      <dev:remarks>
        <maml:para>
          Clonjes SID from domain1.com\user1 to domain2.com\user1
        </maml:para>
        <maml:para/>
        <maml:para/>
        <maml:para/>
      </dev:remarks>
      <command:commandLines>
        <command:commandLine>
          <command:commandText>
            <maml:para/>
          </command:commandText>
        </command:commandLine>
      </command:commandLines>
    </command:example>
  </command:examples>
  <maml:relatedLinks>
    <maml:para>
      https://docs.microsoft.com/en-us/windows/win32/ad/using-dsaddsidhistory
    </maml:para>
  </maml:relatedLinks>
</command:command>