Azure AD Connect:ADSyncTools PowerShell 参考Azure AD Connect: ADSyncTools PowerShell Reference

以下文档提供了 Azure AD Connect 随附的 ADSyncTools.psm1 PowerShell 模块的参考信息。The following documentation provides reference information for the ADSyncTools.psm1 PowerShell Module that is included with Azure AD Connect.

安装 ADSyncTools PowerShell 模块Install the ADSyncTools PowerShell Module

若要安装 ADSyncTools PowerShell 模块,请执行以下操作:To install the ADSyncTools PowerShell Module do the following:

  1. 使用管理权限打开 Windows PowerShellOpen Windows PowerShell with administrative priviledges
  2. 键入或复制并粘贴以下内容:Type or copy and paste the following:
    Import-module -Name "C:\Program Files\Azure Active Directory Connect\Tools\AdSyncTools"
    
  3. 按 Enter。Hit enter.
  4. 若要验证模块是否已安装,请输入或复制并粘贴以下内容“To verify the module was installed, enter or copy and paste the following"
    Get-module AdSyncTools
    
  5. 现在应会看到有关模块的信息。You should now see information about the module.

Clear-ADSyncToolsConsistencyGuidClear-ADSyncToolsConsistencyGuid

摘要SYNOPSIS

清除 AD 用户的 mS-Ds-ConsistencyGuidClear the mS-Ds-ConsistencyGuid from AD User

SYNTAXSYNTAX

Clear-ADSyncToolsConsistencyGuid [-User] <Object> [<CommonParameters>]

说明DESCRIPTION

清除目标 AD 用户的 mS-Ds-ConsistencyGuid 中的值Clear the value in mS-Ds-ConsistencyGuid for the target AD user

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-User-User

要在 AD 中设置的目标用户Target User in AD to set

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Confirm-ADSyncToolsADModuleLoadedConfirm-ADSyncToolsADModuleLoaded

摘要SYNOPSIS

{{Fill in the Synopsis}}{{Fill in the Synopsis}}

SYNTAXSYNTAX

Confirm-ADSyncToolsADModuleLoaded

说明DESCRIPTION

{{Fill in the Description}}{{Fill in the Description}}

示例EXAMPLES

示例 1Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}{{ Add example description here }}

Connect-AdSyncDatabaseConnect-AdSyncDatabase

摘要SYNOPSIS

{{Fill in the Synopsis}}{{Fill in the Synopsis}}

SYNTAXSYNTAX

Connect-AdSyncDatabase [-Server] <String> [[-Instance] <String>] [[-Database] <String>] [[-UserName] <String>]
 [[-Password] <String>] [<CommonParameters>]

说明DESCRIPTION

{{Fill in the Description}}{{Fill in the Description}}

示例EXAMPLES

示例 1Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}{{ Add example description here }}

PARAMETERSPARAMETERS

-Database-Database

{{Fill Database Description}}{{Fill Database Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Instance-Instance

{{Fill Instance Description}}{{Fill Instance Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Password-Password

{{Fill Password Description}}{{Fill Password Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Server-Server

{{Fill Server Description}}{{Fill Server Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-UserName-UserName

{{Fill UserName Description}}{{Fill UserName Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Export-ADSyncToolsConsistencyGuidMigrationExport-ADSyncToolsConsistencyGuidMigration

摘要SYNOPSIS

导出 ConsistencyGuid 报告Export ConsistencyGuid Report

SYNTAXSYNTAX

Export-ADSyncToolsConsistencyGuidMigration [-AlternativeLoginId] [-UserPrincipalName] <String>
 [-ImmutableIdGUID] <String> [-Output] <String> [<CommonParameters>]

说明DESCRIPTION

基于 Import-ADSyncToolsImmutableIdMigration 导入的 CSV 文件生成 ConsistencyGuid 报告Generates a ConsistencyGuid report based on an import CSV file from Import-ADSyncToolsImmutableIdMigration

示例EXAMPLES

示例 1EXAMPLE 1

Import-Csv .\AllSyncUsers.csv | Export-ADSyncToolsConsistencyGuidMigration -Output ".\AllSyncUsers-Report"

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-AlternativeLoginId-AlternativeLoginId

使用备用登录 ID(邮件)Use Alternative Login ID (mail)

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-UserPrincipalName-UserPrincipalName

UserPrincipalNameUserPrincipalName

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-ImmutableIdGUID-ImmutableIdGUID

ImmutableIdGUIDImmutableIdGUID

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Output-Output

CSV 和日志文件的输出文件名Output filename for CSV and LOG files

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Get-ADSyncSQLBrowserInstancesGet-ADSyncSQLBrowserInstances

摘要SYNOPSIS

{{Fill in the Synopsis}}{{Fill in the Synopsis}}

SYNTAXSYNTAX

Get-ADSyncSQLBrowserInstances [[-hostName] <String>]

说明DESCRIPTION

{{Fill in the Description}}{{Fill in the Description}}

示例EXAMPLES

示例 1Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}{{ Add example description here }}

PARAMETERSPARAMETERS

-hostName-hostName

{{Fill hostName Description}}{{Fill hostName Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Get-ADSyncToolsADuserGet-ADSyncToolsADuser

摘要SYNOPSIS

从 AD 获取用户Get user from AD

SYNTAXSYNTAX

Get-ADSyncToolsADuser [-User] <Object> [<CommonParameters>]

说明DESCRIPTION

返回一个 AD 对象待办事项:多林支持Returns an AD object TO DO: Multi forest support

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-User-User

AD 中要设置 ConsistencyGuid AD 的目标用户Target User in AD to set ConsistencyGuid

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Get-ADSyncToolsConsistencyGuidGet-ADSyncToolsConsistencyGuid

摘要SYNOPSIS

从 AD 用户获取 mS-Ds-ConsistencyGuidGet the mS-Ds-ConsistencyGuid from AD User

SYNTAXSYNTAX

Get-ADSyncToolsConsistencyGuid [-User] <Object> [<CommonParameters>]

说明DESCRIPTION

以 GUID 格式返回目标 AD 用户的 mS-Ds-ConsistencyGuid 属性中的值Returns the value in mS-Ds-ConsistencyGuid attribute of the target AD user in GUID format

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-User-User

要在 AD 中设置的目标用户Target User in AD to set

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Get-ADSyncToolsObjectGuidGet-ADSyncToolsObjectGuid

摘要SYNOPSIS

从 AD 用户获取 ObjectGuidGet the ObjectGuid from AD User

SYNTAXSYNTAX

Get-ADSyncToolsObjectGuid [-User] <Object> [<CommonParameters>]

说明DESCRIPTION

以 GUID 格式返回目标 AD 用户的 ObjectGUID 属性中的值Returns the value in ObjectGUID attribute of the target AD user in GUID format

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-User-User

要在 AD 中设置的目标用户Target User in AD to set

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Get-ADSyncToolsRunHistoryGet-ADSyncToolsRunHistory

摘要SYNOPSIS

获取 AAD Connect 运行历史记录Get AAD Connect Run History

SYNTAXSYNTAX

Get-ADSyncToolsRunHistory [[-Days] <Int32>] [<CommonParameters>]

说明DESCRIPTION

以 XML 格式返回 AAD Connect 运行历史记录的函数Function that returns the AAD Connect Run History in XML format

示例EXAMPLES

示例 1EXAMPLE 1

Get-ADSyncToolsRunHistory

示例 2EXAMPLE 2

Get-ADSyncToolsRunHistory -Days 1

PARAMETERSPARAMETERS

-Days-Days

{{Fill Days Description}}{{Fill Days Description}}

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: 3
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Get-ADSyncToolsSourceAnchorChangedGet-ADSyncToolsSourceAnchorChanged

摘要SYNOPSIS

获取发生了 SourceAnchor 更改错误的用户Get users with SourceAnchor changed errors

SYNTAXSYNTAX

Get-ADSyncToolsSourceAnchorChanged [-sourcePath] <Object> [-outputPath] <Object> [<CommonParameters>]

说明DESCRIPTION

函数将查询 AAD Connect 运行历史记录,并导出报告以下错误的所有用户:“SourceAnchor 属性已更改”错误的所有用户。Function queries AAD Connect Run History and exports all the users reporting the Error: "SourceAnchor attribute has changed."

示例EXAMPLES

示例 1EXAMPLE 1

#Required Parameters

$sourcePath = Read-Host -Prompt "Enter your log file path with file name" #"<Source_Path>" $outputPath = Read-Host -Prompt "Enter your out file path with file name" #"<Out_Path>"$sourcePath = Read-Host -Prompt "Enter your log file path with file name" #"<Source_Path>" $outputPath = Read-Host -Prompt "Enter your out file path with file name" #"<Out_Path>"

Get-ADSyncToolsUsersSourceAnchorChanged -sourcePath $sourcePath -outputPath $outputPathGet-ADSyncToolsUsersSourceAnchorChanged -sourcePath $sourcePath -outputPath $outputPath

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-sourcePath-sourcePath

{{Fill sourcePath Description}}{{Fill sourcePath Description}}

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-outputPath-outputPath

{{Fill outputPath Description}}{{Fill outputPath Description}}

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Import-ADSyncToolsImmutableIdMigrationImport-ADSyncToolsImmutableIdMigration

摘要SYNOPSIS

从 AAD 导入 ImmutableIDImport ImmutableID from AAD

SYNTAXSYNTAX

Import-ADSyncToolsImmutableIdMigration [-Output] <String> [-IncludeSyncUsersFromRecycleBin]
 [<CommonParameters>]

说明DESCRIPTION

生成包含所有 Azure AD 同步用户的文件,这些用户具有符合 GUID 格式要求的 ImmutableID 值:MSOnline PowerShell 模块Generates a file with all Azure AD Synchronized users containing the ImmutableID value in GUID format Requirements: MSOnline PowerShell Module

示例EXAMPLES

示例 1EXAMPLE 1

Import-ADSyncToolsImmutableIdMigration -OutputFile '.\AllSyncUsers.csv'

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-Output-Output

输出 CSV 文件Output CSV file

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IncludeSyncUsersFromRecycleBin-IncludeSyncUsersFromRecycleBin

从 Azure AD 回收站获取同步用户Get Synchronized Users from Azure AD Recycle Bin

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Invoke-AdSyncDatabaseQueryInvoke-AdSyncDatabaseQuery

摘要SYNOPSIS

{{Fill in the Synopsis}}{{Fill in the Synopsis}}

SYNTAXSYNTAX

Invoke-AdSyncDatabaseQuery [-SqlConnection] <SqlConnection> [[-Query] <String>] [<CommonParameters>]

说明DESCRIPTION

{{Fill in the Description}}{{Fill in the Description}}

示例EXAMPLES

示例 1Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}{{ Add example description here }}

PARAMETERSPARAMETERS

-Query-Query

{{Fill Query Description}}{{Fill Query Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SqlConnection-SqlConnection

{{Fill SqlConnection Description}}{{Fill SqlConnection Description}}

Type: SqlConnection
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Remove-ADSyncToolsExpiredCertificatesRemove-ADSyncToolsExpiredCertificates

摘要SYNOPSIS

用于从 UserCertificate 属性中删除已过期证书的脚本Script to Remove Expired Certificates from UserCertificate Attribute

SYNTAXSYNTAX

Remove-ADSyncToolsExpiredCertificates [-TargetOU] <String> [[-BackupOnly] <Boolean>] [-ObjectClass] <String>
 [<CommonParameters>]

说明DESCRIPTION

此脚本采用 Active Directory 域的目标组织单位中的所有对象(已按对象类(用户/计算机)筛选),并删除 UserCertificate 属性中的所有已过期证书。This script takes all the objects from a target Organizational Unit in your Active Directory domain - filtered by Object Class (User/Computer) and deletes all expired certificates present in the UserCertificate attribute. 默认情况下(仅限 BackupOnly 模式),它只会将已过期的证书备份到文件,而不会在 AD 中执行任何更改。By default (BackupOnly mode) it will only backup expired certificates to a file and not do any changes in AD. 如果使用 -BackupOnly $false,则在将这些对象的 UserCertificate 属性中的任何已过期证书复制到文件后,会从 AD 中删除该证书。If you use -BackupOnly $false then any Expired Certificate present in UserCertificate attribute for these objects will be removed from AD after being copied to file. 每个证书将备份到单独的文件名:ObjectClass_ObjectGUID_CertThumprint.cer。该脚本还会创建 CSV 格式的日志文件,其中显示证书有效或已过期的所有用户,包括执行的实际操作(已跳过/已导出/已删除)。Each certificate will be backed up to a separated filename: ObjectClass_ObjectGUID_CertThumprint.cer The script will also create a log file in CSV format showing all the users with certificates that either are valid or expired including the actual action taken (Skipped/Exported/Deleted).

示例EXAMPLES

示例 1EXAMPLE 1

Check all users in target OU - Expired Certificates will be copied to separated files and no certificates will be removed

Remove-ADSyncToolsExpiredCertificates -TargetOU "OU=Users,OU=Corp,DC=Contoso,DC=com" -ObjectClass userRemove-ADSyncToolsExpiredCertificates -TargetOU "OU=Users,OU=Corp,DC=Contoso,DC=com" -ObjectClass user

示例 2EXAMPLE 2

Delete Expired Certs from all Computer objects in target OU - Expired Certificates will be copied to files and removed from AD

Remove-ADSyncToolsExpiredCertificates -TargetOU "OU=Computers,OU=Corp,DC=Contoso,DC=com" -ObjectClass computer -BackupOnly $falseRemove-ADSyncToolsExpiredCertificates -TargetOU "OU=Computers,OU=Corp,DC=Contoso,DC=com" -ObjectClass computer -BackupOnly $false

PARAMETERSPARAMETERS

-TargetOU-TargetOU

要在其中查找 AD 对象的目标 OUTarget OU to lookup for AD objects

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-BackupOnly-BackupOnly

BackupOnly 不会从 AD 中删除任何证书BackupOnly will not delete any certificates from AD

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

-ObjectClass-ObjectClass

对象类筛选器Object Class filter

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Repair-ADSyncToolsAutoUpgradeStateRepair-ADSyncToolsAutoUpgradeState

摘要SYNOPSIS

简短说明Short description

SYNTAXSYNTAX

Repair-ADSyncToolsAutoUpgradeState

说明DESCRIPTION

长说明Long description

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

Resolve-ADSyncHostAddressResolve-ADSyncHostAddress

摘要SYNOPSIS

{{Fill in the Synopsis}}{{Fill in the Synopsis}}

SYNTAXSYNTAX

Resolve-ADSyncHostAddress [[-hostName] <String>]

说明DESCRIPTION

{{Fill in the Description}}{{Fill in the Description}}

示例EXAMPLES

示例 1Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}{{ Add example description here }}

PARAMETERSPARAMETERS

-hostName-hostName

{{Fill hostName Description}}{{Fill hostName Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Restore-ADSyncToolsExpiredCertificatesRestore-ADSyncToolsExpiredCertificates

摘要SYNOPSIS

(TO DO) 从证书文件还原 AD UserCertificate 属性(TO DO) Restores AD UserCertificate attribute from a certificate file

SYNTAXSYNTAX

Restore-ADSyncToolsExpiredCertificates

说明DESCRIPTION

长说明Long description

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

Set-ADSyncToolsConsistencyGuidSet-ADSyncToolsConsistencyGuid

摘要SYNOPSIS

对 AD 用户设置 mS-Ds-ConsistencyGuidSet mS-Ds-ConsistencyGuid on AD User

SYNTAXSYNTAX

Set-ADSyncToolsConsistencyGuid [-User] <Object> [-Value] <Object> [<CommonParameters>]

说明DESCRIPTION

在目标 AD 用户的 mS-Ds-ConsistencyGuid 属性中设置值Set a value in mS-Ds-ConsistencyGuid attribute for the target AD user

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-User-User

AD 中要设置 ConsistencyGuid AD 的目标用户Target User in AD to set ConsistencyGuid

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Value-Value

ImmutableId(字节数组、GUID、GUID 字符串或 Base64 字符串)ImmutableId (Byte array, GUID, GUID string or Base64 string)

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Test-ADSyncNetworkPortTest-ADSyncNetworkPort

摘要SYNOPSIS

{{Fill in the Synopsis}}{{Fill in the Synopsis}}

SYNTAXSYNTAX

Test-ADSyncNetworkPort [[-hostName] <String>] [[-port] <String>]

说明DESCRIPTION

{{Fill in the Description}}{{Fill in the Description}}

示例EXAMPLES

示例 1Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}{{ Add example description here }}

PARAMETERSPARAMETERS

-hostName-hostName

{{Fill hostName Description}}{{Fill hostName Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-port-port

{{Fill port Description}}{{Fill port Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Trace-ADSyncToolsADImportTrace-ADSyncToolsADImport

摘要SYNOPSIS

通过 AD 导入步骤创建跟踪文件Creates a trace file from and AD Import Step

SYNTAXSYNTAX

Trace-ADSyncToolsADImport [[-ADConnectorXML] <String>] [[-dc] <String>] [[-rootDN] <String>]
 [[-filter] <String>] [-SkipCredentials] [[-ADwatermark] <String>] [<CommonParameters>]

说明DESCRIPTION

从给定 AD 水印检查点(分区 Cookie)跟踪 AAD Connect AD 导入运行的所有 ldap 查询。Traces all ldap queries of an AAD Connect AD Import run from a given AD watermark checkpoint (partition cookie). 在当前文件夹中创建跟踪文件“.\ADimportTrace_yyyyMMddHHmmss.log”。Creates a trace file '.\ADimportTrace_yyyyMMddHHmmss.log' on the current folder.

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-ADConnectorXML-ADConnectorXML

{{Fill ADConnectorXML Description}}{{Fill ADConnectorXML Description}}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-dc-dc

AD 连接器导出的 XML 文件XML file of AD Connector Export

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: DC1.domain.contoso.com
Accept pipeline input: False
Accept wildcard characters: False

-rootDN-rootDN

目标域控制器Target Domain Controller

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: DC=Domain,DC=Contoso,DC=com
Accept pipeline input: False
Accept wildcard characters: False

-filter-filter

林根 DNForest Root DN

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: (&(objectClass=*))
Accept pipeline input: False
Accept wildcard characters: False

-SkipCredentials-SkipCredentials

要跟踪的 AD 对象类型 >* = 所有对象类型Types of AD objects to trace > * = all object types

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ADwatermark-ADwatermark

如果已以域管理员身份运行,则无需提供 AD 凭据。If already running as Domain Administrator there's no need to provide AD credentials. 手动输入水印,而不是使用 XML 文件,例如 $ADwatermark = "TVNEUwMAAAAXyK9ir1zSAQAAAAAAAAAA(...)"Manual input of watermark, instead of XML file e.g. $ADwatermark = "TVNEUwMAAAAXyK9ir1zSAQAAAAAAAAAA(...)"

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Trace-ADSyncToolsLdapQueryTrace-ADSyncToolsLdapQuery

摘要SYNOPSIS

简短说明Short description

SYNTAXSYNTAX

Trace-ADSyncToolsLdapQuery [-Context] <String> [-Server] <String> [-Port] <Int32> [-Filter] <String>
 [<CommonParameters>]

说明DESCRIPTION

长说明Long description

示例EXAMPLES

示例 1EXAMPLE 1

Example of how to use this cmdlet

示例 2EXAMPLE 2

Another example of how to use this cmdlet

PARAMETERSPARAMETERS

-Context-Context

参数 1 帮助说明Param1 help description

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Server-Server

参数 2 帮助说明Param2 help description

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: Localhost
Accept pipeline input: False
Accept wildcard characters: False

-Port-Port

参数 2 帮助说明Param2 help description

Type: Int32
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: 389
Accept pipeline input: False
Accept wildcard characters: False

-Filter-Filter

参数 2 帮助说明Param2 help description

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: (objectClass=*)
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Update-ADSyncToolsConsistencyGuidMigrationUpdate-ADSyncToolsConsistencyGuidMigration

摘要SYNOPSIS

使用新的 ConsistencyGuid (ImmutableId) 更新用户Updates users with the new ConsistencyGuid (ImmutableId)

SYNTAXSYNTAX

Update-ADSyncToolsConsistencyGuidMigration [[-DistinguishedName] <String>] [-ImmutableIdGUID] <String>
 [-Action] <String> [-Output] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

说明DESCRIPTION

使用取自 ConsistencyGuid 报告的新 ConsistencyGuid (ImmutableId) 值更新用户。此函数支持 WhatIf 开关。注意:必须导入制表符分隔的 ConsistencyGuid 报告Updates users with the new ConsistencyGuid (ImmutableId) value taken from the ConsistencyGuid Report This function supports the WhatIf switch Note: ConsistencyGuid Report must be imported with Tab Demiliter

示例EXAMPLES

示例 1EXAMPLE 1

Import-Csv .\AllSyncUsersTEST-Report.csv -Delimiter "`t"| Update-ADSyncToolsConsistencyGuidMigration -Output .\AllSyncUsersTEST-Result2 -WhatIf

示例 2EXAMPLE 2

Import-Csv .\AllSyncUsersTEST-Report.csv -Delimiter "`t"| Update-ADSyncToolsConsistencyGuidMigration -Output .\AllSyncUsersTEST-Result2

PARAMETERSPARAMETERS

-DistinguishedName-DistinguishedName

DistinguishedNameDistinguishedName

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: False
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-ImmutableIdGUID-ImmutableIdGUID

ImmutableIdGUIDImmutableIdGUID

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Action-Action

操作Action

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Output-Output

日志文件的输出文件名Output filename for LOG files

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf-WhatIf

显示运行该 cmdlet 时会发生什么情况。Shows what would happen if the cmdlet runs. cmdlet 未运行。The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm-Confirm

提示你在运行 cmdlet 之前进行确认。Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersCommonParameters

此 cmdlet 支持以下常见参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutVariable、-OutBuffer、-PipelineVariable、-Verbose、-WarningAction 和 -WarningVariable。This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216) 。For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).